mirror of
https://github.com/postgres/postgres.git
synced 2025-09-03 15:22:11 +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:
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: spin.h,v 1.12 2000/05/31 00:28:38 petere Exp $
|
||||
* $Id: spin.h,v 1.13 2000/11/28 23:27:57 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -19,11 +19,10 @@
|
||||
/*
|
||||
* two implementations of spin locks
|
||||
*
|
||||
* sequent, sparc, sun3: real spin locks. uses a TAS instruction; see
|
||||
* src/storage/ipc/s_lock.c for details.
|
||||
*
|
||||
* default: fake spin locks using semaphores. see spin.c
|
||||
* Where TAS instruction is available: real spin locks.
|
||||
* See src/storage/ipc/s_lock.c for details.
|
||||
*
|
||||
* Otherwise: fake spin locks using semaphores. see spin.c
|
||||
*/
|
||||
|
||||
typedef int SPINLOCK;
|
||||
@@ -32,8 +31,10 @@ typedef int SPINLOCK;
|
||||
extern bool Trace_spinlocks;
|
||||
#endif
|
||||
|
||||
extern void CreateSpinlocks(IPCKey key);
|
||||
extern void InitSpinLocks(void);
|
||||
|
||||
extern int SLockShmemSize(void);
|
||||
extern void CreateSpinlocks(PGShmemHeader *seghdr);
|
||||
|
||||
extern void SpinAcquire(SPINLOCK lockid);
|
||||
extern void SpinRelease(SPINLOCK lockid);
|
||||
|
||||
|
Reference in New Issue
Block a user