diff options
| author | Tom Lane | 2012-05-10 18:34:22 +0000 |
|---|---|---|
| committer | Tom Lane | 2012-05-10 18:34:53 +0000 |
| commit | f40022f1adaeff85b01d98fea38cf5aa16814aa7 (patch) | |
| tree | 3a5337271306c5df48a23df0e8abc6729c771e92 /src/backend/postmaster/bgwriter.c | |
| parent | 586d356bc5af1aa61f965f6ba1cbeb1533ec8c99 (diff) | |
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.
Diffstat (limited to 'src/backend/postmaster/bgwriter.c')
| -rw-r--r-- | src/backend/postmaster/bgwriter.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/src/backend/postmaster/bgwriter.c b/src/backend/postmaster/bgwriter.c index abb665ee50d..5daf8c6177b 100644 --- a/src/backend/postmaster/bgwriter.c +++ b/src/backend/postmaster/bgwriter.c @@ -48,7 +48,6 @@ #include "storage/buf_internals.h" #include "storage/ipc.h" #include "storage/lwlock.h" -#include "storage/pmsignal.h" #include "storage/proc.h" #include "storage/shmem.h" #include "storage/smgr.h" @@ -323,11 +322,9 @@ BackgroundWriterMain(void) /* * Emergency bailout if postmaster has died. This is to avoid the - * necessity for manual cleanup of all postmaster children. Note - * that we mustn't trust the WL_POSTMASTER_DEATH result flag entirely; - * if it is set, recheck with PostmasterIsAlive before believing it. + * necessity for manual cleanup of all postmaster children. */ - if ((rc & WL_POSTMASTER_DEATH) && !PostmasterIsAlive()) + if (rc & WL_POSTMASTER_DEATH) exit(1); prev_hibernate = can_hibernate; |
