aboutsummaryrefslogtreecommitdiff
path: root/src/include/storage/buf_internals.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-12-29 18:08:05 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-12-29 18:08:05 +0000
commit195f1642285d59b4bd42ec2ba8bbcf46b8aedd93 (patch)
tree22da2794ecf95bafe907556acaa83ea45ef1042b /src/include/storage/buf_internals.h
parente135d9631bcf789ce3aa3a351e2d8af7fc743896 (diff)
downloadpostgresql-195f1642285d59b4bd42ec2ba8bbcf46b8aedd93.tar.gz
postgresql-195f1642285d59b4bd42ec2ba8bbcf46b8aedd93.zip
Get rid of the SpinLockAcquire/SpinLockAcquire_NoHoldoff distinction
in favor of having just one set of macros that don't do HOLD/RESUME_INTERRUPTS (hence, these correspond to the old SpinLockAcquire_NoHoldoff case). Given our coding rules for spinlock use, there is no reason to allow CHECK_FOR_INTERRUPTS to be done while holding a spinlock, and also there is no situation where ImmediateInterruptOK will be true while holding a spinlock. Therefore doing HOLD/RESUME_INTERRUPTS while taking/releasing a spinlock is just a waste of cycles. Qingqing Zhou and Tom Lane.
Diffstat (limited to 'src/include/storage/buf_internals.h')
-rw-r--r--src/include/storage/buf_internals.h20
1 files changed, 6 insertions, 14 deletions
diff --git a/src/include/storage/buf_internals.h b/src/include/storage/buf_internals.h
index 3bab9e85b40..71fa0b08d48 100644
--- a/src/include/storage/buf_internals.h
+++ b/src/include/storage/buf_internals.h
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/storage/buf_internals.h,v 1.83 2005/11/22 18:17:31 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/storage/buf_internals.h,v 1.84 2005/12/29 18:08:05 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -138,24 +138,16 @@ typedef struct sbufdesc
#define FREENEXT_NOT_IN_LIST (-2)
/*
- * Macros for acquiring/releasing a buffer header's spinlock. The
- * NoHoldoff cases may be used when we know that we hold some LWLock
- * and therefore interrupts are already held off. Do not apply these
- * to local buffers!
+ * Macros for acquiring/releasing a shared buffer header's spinlock.
+ * Do not apply these to local buffers!
*
* Note: as a general coding rule, if you are using these then you probably
- * want to be using a volatile-qualified pointer to the buffer header, to
+ * need to be using a volatile-qualified pointer to the buffer header, to
* ensure that the compiler doesn't rearrange accesses to the header to
* occur before or after the spinlock is acquired/released.
*/
-#define LockBufHdr(bufHdr) \
- SpinLockAcquire(&(bufHdr)->buf_hdr_lock)
-#define UnlockBufHdr(bufHdr) \
- SpinLockRelease(&(bufHdr)->buf_hdr_lock)
-#define LockBufHdr_NoHoldoff(bufHdr) \
- SpinLockAcquire_NoHoldoff(&(bufHdr)->buf_hdr_lock)
-#define UnlockBufHdr_NoHoldoff(bufHdr) \
- SpinLockRelease_NoHoldoff(&(bufHdr)->buf_hdr_lock)
+#define LockBufHdr(bufHdr) SpinLockAcquire(&(bufHdr)->buf_hdr_lock)
+#define UnlockBufHdr(bufHdr) SpinLockRelease(&(bufHdr)->buf_hdr_lock)
/* in buf_init.c */