diff options
author | Robert Haas <rhaas@postgresql.org> | 2015-11-16 18:50:06 -0500 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2015-11-16 18:50:06 -0500 |
commit | e93b62985f9c69dcb6f0747450809fff64b78a6e (patch) | |
tree | 8a7f16d6735c2711544fa726ee2300d2b3a0fed9 /src/include/storage/buf_internals.h | |
parent | 8004953b5a2449c26c4e082771276b2f8629d153 (diff) | |
download | postgresql-e93b62985f9c69dcb6f0747450809fff64b78a6e.tar.gz postgresql-e93b62985f9c69dcb6f0747450809fff64b78a6e.zip |
Remove volatile qualifiers from bufmgr.c and freelist.c
Prior to commit 0709b7ee72e4bc71ad07b7120acd117265ab51d0, access to
variables within a spinlock-protected critical section had to be done
through a volatile pointer, but that should no longer be necessary.
Review by Andres Freund
Diffstat (limited to 'src/include/storage/buf_internals.h')
-rw-r--r-- | src/include/storage/buf_internals.h | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/include/storage/buf_internals.h b/src/include/storage/buf_internals.h index 521ee1cfaea..19247c4b2be 100644 --- a/src/include/storage/buf_internals.h +++ b/src/include/storage/buf_internals.h @@ -194,11 +194,6 @@ typedef union BufferDescPadded /* * 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 - * 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) @@ -216,10 +211,10 @@ extern BufferDesc *LocalBufferDescriptors; */ /* freelist.c */ -extern volatile BufferDesc *StrategyGetBuffer(BufferAccessStrategy strategy); -extern void StrategyFreeBuffer(volatile BufferDesc *buf); +extern BufferDesc *StrategyGetBuffer(BufferAccessStrategy strategy); +extern void StrategyFreeBuffer(BufferDesc *buf); extern bool StrategyRejectBuffer(BufferAccessStrategy strategy, - volatile BufferDesc *buf); + BufferDesc *buf); extern int StrategySyncStart(uint32 *complete_passes, uint32 *num_buf_alloc); extern void StrategyNotifyBgWriter(int bgwprocno); |