Use FeBeWaitSet for walsender.c.
authorThomas Munro <tmunro@postgresql.org>
Mon, 1 Mar 2021 02:17:28 +0000 (15:17 +1300)
committerThomas Munro <tmunro@postgresql.org>
Mon, 1 Mar 2021 03:19:38 +0000 (16:19 +1300)
commit6230912f23904aa6cb2a1f948ca9b08235b4f54a
tree235956131449191383a4a7bb116b0f81e6626616
parenta042ba2ba7bb44f191f6f9398da27f04a958a0db
Use FeBeWaitSet for walsender.c.

This avoids the need to set up and tear down a fresh WaitEventSet every
time we need need to wait.  We have to add an explicit exit on
postmaster exit (FeBeWaitSet isn't set up to do that automatically), so
move the code to do that into a new function to avoid repetition.

Reviewed-by: Kyotaro Horiguchi <horikyota.ntt@gmail.com> (earlier version)
Discussion: http://postgr.es/m/CA%2BhUKGJAC4Oqao%3DqforhNey20J8CiG2R%3DoBPqvfR0vOJrFysGw%40mail.gmail.com
src/backend/replication/walsender.c