aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/async.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2000-11-28 23:27:57 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2000-11-28 23:27:57 +0000
commitc715fdea267843fd7fae4253aee0ae91e941393c (patch)
treeb19e41edd57afe461ebc3dae271c8a5d17eba710 /src/backend/commands/async.c
parent914822713c9a8ce452860fb895ef79ecfd583746 (diff)
downloadpostgresql-c715fdea267843fd7fae4253aee0ae91e941393c.tar.gz
postgresql-c715fdea267843fd7fae4253aee0ae91e941393c.zip
Significant cleanups in SysV IPC handling (shared mem and semaphores).
IPC key assignment will now work correctly even when multiple postmasters are using same logical port number (which is possible given -k switch). There is only one shared-mem segment per postmaster now, not 3. Rip out broken code for non-TAS case in bufmgr and xlog, substitute a complete S_LOCK emulation using semaphores in spin.c. TAS and non-TAS logic is now exactly the same. When deadlock is detected, "Deadlock detected" is now the elog(ERROR) message, rather than a NOTICE that comes out before an unhelpful ERROR.
Diffstat (limited to 'src/backend/commands/async.c')
-rw-r--r--src/backend/commands/async.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/backend/commands/async.c b/src/backend/commands/async.c
index e364d53b9df..6316262d042 100644
--- a/src/backend/commands/async.c
+++ b/src/backend/commands/async.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.72 2000/11/21 21:15:59 petere Exp $
+ * $Header: /cvsroot/pgsql/src/backend/commands/async.c,v 1.73 2000/11/28 23:27:54 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -119,8 +119,8 @@ static Dllist *pendingNotifies = NULL;
static volatile int notifyInterruptEnabled = 0;
static volatile int notifyInterruptOccurred = 0;
-/* True if we've registered an on_shmem_exit cleanup (or at least tried to). */
-static int unlistenExitRegistered = 0;
+/* True if we've registered an on_shmem_exit cleanup */
+static bool unlistenExitRegistered = false;
static void Async_UnlistenAll(void);
@@ -253,9 +253,8 @@ Async_Listen(char *relname, int pid)
*/
if (!unlistenExitRegistered)
{
- if (on_shmem_exit(Async_UnlistenOnExit, 0) < 0)
- elog(NOTICE, "Async_Listen: out of shmem_exit slots");
- unlistenExitRegistered = 1;
+ on_shmem_exit(Async_UnlistenOnExit, 0);
+ unlistenExitRegistered = true;
}
}