mirror of
https://github.com/postgres/postgres.git
synced 2026-04-29 02:00:35 -04:00
Move memory barrier in UnlockBufHdr to before releasing the lock.
This bug appears to have been introduced late in the development of
48354581a4 ("Allow Pin/UnpinBuffer to operate in a lockfree
manner.").
Found while debugging a bug which turned out to be independent of the
commit mentioned above.
Backpatch: -
This commit is contained in:
parent
975ad4e602
commit
87a3023c60
1 changed files with 1 additions and 1 deletions
|
|
@ -242,8 +242,8 @@ extern PGDLLIMPORT LWLockMinimallyPadded *BufferIOLWLockArray;
|
|||
extern uint32 LockBufHdr(BufferDesc *desc);
|
||||
#define UnlockBufHdr(desc, s) \
|
||||
do { \
|
||||
pg_atomic_write_u32(&(desc)->state, (s) & (~BM_LOCKED)); \
|
||||
pg_write_barrier(); \
|
||||
pg_atomic_write_u32(&(desc)->state, (s) & (~BM_LOCKED)); \
|
||||
} while (0)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue