aboutsummaryrefslogtreecommitdiff
path: root/src/include/storage/buf_internals.h
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/include/storage/buf_internals.h
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/include/storage/buf_internals.h')
-rw-r--r--src/include/storage/buf_internals.h9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/include/storage/buf_internals.h b/src/include/storage/buf_internals.h
index fc15e59859b..ae417118878 100644
--- a/src/include/storage/buf_internals.h
+++ b/src/include/storage/buf_internals.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: buf_internals.h,v 1.43 2000/11/08 22:10:02 tgl Exp $
+ * $Id: buf_internals.h,v 1.44 2000/11/28 23:27:57 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -16,6 +16,7 @@
#include "storage/buf.h"
#include "storage/lmgr.h"
+#include "storage/s_lock.h"
/* Buf Mgr constants */
/* in bufmgr.c */
@@ -100,11 +101,9 @@ typedef struct sbufdesc
BufFlags flags; /* see bit definitions above */
unsigned refcount; /* # of times buffer is pinned */
-#ifdef HAS_TEST_AND_SET
- /* can afford a dedicated lock if test-and-set locks are available */
- slock_t io_in_progress_lock;
+ slock_t io_in_progress_lock; /* to block for I/O to complete */
slock_t cntx_lock; /* to lock access to page context */
-#endif /* HAS_TEST_AND_SET */
+
unsigned r_locks; /* # of shared locks */
bool ri_lock; /* read-intent lock */
bool w_lock; /* context exclusively locked */