1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-15 05:46:52 +03:00

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.
This commit is contained in:
Tom Lane
2000-11-28 23:27:57 +00:00
parent 914822713c
commit c715fdea26
27 changed files with 1172 additions and 1755 deletions

View File

@@ -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;
}
}