Use an shmem_exit callback to remove backend from PMChildFlags on exit

This seems nicer than having to duplicate the logic between
InitProcess() and ProcKill() for which child processes have a
PMChildFlags slot.

Move the MarkPostmasterChildActive() call earlier in InitProcess(),
out of the section protected by the spinlock.

Reviewed-by: Andres Freund <and...@anarazel.de>
Discussion: 
https://www.postgresql.org/message-id/a102f15f-eac4-4ff2-af02-f9ff209ec...@iki.fi

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2bbc261ddbdfee2def5d14ee9fcc09c70bdf84e6

Modified Files
--------------
src/backend/storage/ipc/pmsignal.c | 17 +++++++++++++----
src/backend/storage/lmgr/proc.c    | 38 +++++++++++++-------------------------
src/include/storage/pmsignal.h     |  3 +--
3 files changed, 27 insertions(+), 31 deletions(-)

Reply via email to