mirror of
https://github.com/postgres/postgres.git
synced 2025-07-26 01:22:12 +03:00
Make it easy to detach completely from shared memory.
The new function dsm_detach_all() can be used either by postmaster children that don't wish to take any risk of accidentally corrupting shared memory; or by forked children of regular backends with the same need. This patch also updates the postmaster children that already do PGSharedMemoryDetach() to do dsm_detach_all() as well. Per discussion with Tom Lane.
This commit is contained in:
@ -40,6 +40,7 @@
|
||||
#include "postmaster/fork_process.h"
|
||||
#include "postmaster/pgarch.h"
|
||||
#include "postmaster/postmaster.h"
|
||||
#include "storage/dsm.h"
|
||||
#include "storage/fd.h"
|
||||
#include "storage/ipc.h"
|
||||
#include "storage/latch.h"
|
||||
@ -163,6 +164,7 @@ pgarch_start(void)
|
||||
on_exit_reset();
|
||||
|
||||
/* Drop our connection to postmaster's shared memory, as well */
|
||||
dsm_detach_all();
|
||||
PGSharedMemoryDetach();
|
||||
|
||||
PgArchiverMain(0, NULL);
|
||||
|
Reference in New Issue
Block a user