diff options
| author | Tom Lane | 2009-01-03 17:08:39 +0000 |
|---|---|---|
| committer | Tom Lane | 2009-01-03 17:08:39 +0000 |
| commit | dad75a62bfb25e3228d1db73e4a06e2c6bd22dd2 (patch) | |
| tree | 406f7bbf159c3aec4d3f16de7be4d030a63e10b5 /src/include | |
| parent | bbeb0bbf6b3e5fdb7cff1a87885f43139ace5c4b (diff) | |
Create a "shmem_startup_hook" to be called at the end of shared memory
initialization, to give loadable modules a reasonable place to perform
creation of any shared memory areas they need. This is the logical conclusion
of our previous creation of RequestAddinShmemSpace() and RequestAddinLWLocks().
We don't need an explicit shmem_shutdown_hook, because the existing
on_shmem_exit and on_proc_exit mechanisms serve that need.
Also, adjust SubPostmasterMain so that libraries that got loaded into the
postmaster will be loaded into all child processes, not only regular backends.
This improves consistency with the non-EXEC_BACKEND behavior, and might be
necessary for functionality for some types of add-ons.
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/storage/ipc.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/include/storage/ipc.h b/src/include/storage/ipc.h index 8cf326d57c..bcab86d8aa 100644 --- a/src/include/storage/ipc.h +++ b/src/include/storage/ipc.h @@ -11,7 +11,7 @@ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/storage/ipc.h,v 1.76 2009/01/01 17:24:01 momjian Exp $ + * $PostgreSQL: pgsql/src/include/storage/ipc.h,v 1.77 2009/01/03 17:08:39 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -19,6 +19,7 @@ #define IPC_H typedef void (*pg_on_exit_callback) (int code, Datum arg); +typedef void (*shmem_startup_hook_type) (void); /*---------- * API for handling cleanup that must occur during either ereport(ERROR) @@ -71,6 +72,8 @@ extern void cancel_shmem_exit(pg_on_exit_callback function, Datum arg); extern void on_exit_reset(void); /* ipci.c */ +extern PGDLLIMPORT shmem_startup_hook_type shmem_startup_hook; + extern void CreateSharedMemoryAndSemaphores(bool makePrivate, int port); #endif /* IPC_H */ |
