Make WaitLatch's WL_POSTMASTER_DEATH result trustworthy; simplify callers.
Tom Lane <tgl@sss.pgh.pa.us>
Make WaitLatch's WL_POSTMASTER_DEATH result trustworthy; simplify callers. Per a suggestion from Peter Geoghegan, make WaitLatch responsible for verifying that the WL_POSTMASTER_DEATH bit it returns is truthful (by testing PostmasterIsAlive). Then simplify its callers, who no longer need to do that for themselves. Remove weasel wording about falsely-set result bits from WaitLatch's API contract.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/port/unix_latch.c | modified | +24 −11 |
| src/backend/port/win32_latch.c | modified | +10 −2 |
| src/backend/postmaster/autovacuum.c | modified | +5 −4 |
| src/backend/postmaster/bgwriter.c | modified | +2 −5 |
| src/backend/postmaster/checkpointer.c | modified | +2 −5 |
| src/backend/postmaster/pgstat.c | modified | +2 −5 |
| src/backend/postmaster/walwriter.c | modified | +2 −5 |