aboutsummaryrefslogtreecommitdiff
path: root/src/backend/postmaster/postmaster.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-05-05 00:03:29 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-05-05 00:03:29 +0000
commit72a3902a664c7fbceb2034e28e444b28f96fa717 (patch)
treeff42e4494af6ea1c1cdf524f3feb5fc670217f0c /src/backend/postmaster/postmaster.c
parent91fc10fdacfcbadc123fd9d8ee16a4568f8c636b (diff)
downloadpostgresql-72a3902a664c7fbceb2034e28e444b28f96fa717.tar.gz
postgresql-72a3902a664c7fbceb2034e28e444b28f96fa717.zip
Create an internal semaphore API that is not tied to SysV semaphores.
As proof of concept, provide an alternate implementation based on POSIX semaphores. Also push the SysV shared-memory implementation into a separate file so that it can be replaced conveniently.
Diffstat (limited to 'src/backend/postmaster/postmaster.c')
-rw-r--r--src/backend/postmaster/postmaster.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index 0ce817b5b39..a3a8f2521e5 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -37,7 +37,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.272 2002/04/04 04:25:48 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/postmaster/postmaster.c,v 1.273 2002/05/05 00:03:28 tgl Exp $
*
* NOTES
*
@@ -1362,17 +1362,14 @@ static void
reset_shared(unsigned short port)
{
/*
- * Reset assignment of shared mem and semaphore IPC keys. Doing this
- * means that in normal cases we'll assign the same keys on each
- * "cycle of life", and thereby avoid leaving dead IPC objects
- * floating around if the postmaster crashes and is restarted.
- */
- IpcInitKeyAssignment(port);
-
- /*
* Create or re-create shared memory and semaphores.
+ *
+ * Note: in each "cycle of life" we will normally assign the same IPC
+ * keys (if using SysV shmem and/or semas), since the port number is
+ * used to determine IPC keys. This helps ensure that we will clean up
+ * dead IPC objects if the postmaster crashes and is restarted.
*/
- CreateSharedMemoryAndSemaphores(false, MaxBackends);
+ CreateSharedMemoryAndSemaphores(false, MaxBackends, port);
}