From f40022f1adaeff85b01d98fea38cf5aa16814aa7 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Thu, 10 May 2012 14:34:22 -0400 Subject: 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. --- src/backend/postmaster/checkpointer.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/backend/postmaster/checkpointer.c') diff --git a/src/backend/postmaster/checkpointer.c b/src/backend/postmaster/checkpointer.c index 7f8ba95c44d..5db60cd5d98 100644 --- a/src/backend/postmaster/checkpointer.c +++ b/src/backend/postmaster/checkpointer.c @@ -50,7 +50,6 @@ #include "storage/bufmgr.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" @@ -581,11 +580,9 @@ CheckpointerMain(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); } } -- cgit v1.2.3