diff options
Diffstat (limited to 'src/backend/storage')
-rw-r--r-- | src/backend/storage/buffer/bufmgr.c | 8 | ||||
-rw-r--r-- | src/backend/storage/lmgr/lwlock.c | 4 | ||||
-rw-r--r-- | src/backend/storage/lmgr/s_lock.c | 4 |
3 files changed, 12 insertions, 4 deletions
diff --git a/src/backend/storage/buffer/bufmgr.c b/src/backend/storage/buffer/bufmgr.c index 47644ea528b..462dd4a2262 100644 --- a/src/backend/storage/buffer/bufmgr.c +++ b/src/backend/storage/buffer/bufmgr.c @@ -4029,9 +4029,11 @@ rnode_comparator(const void *p1, const void *p2) uint32 LockBufHdr(BufferDesc *desc) { - SpinDelayStatus delayStatus = init_local_spin_delay(); + SpinDelayStatus delayStatus; uint32 old_buf_state; + init_local_spin_delay(&delayStatus); + while (true) { /* set BM_LOCKED flag */ @@ -4055,9 +4057,11 @@ LockBufHdr(BufferDesc *desc) static uint32 WaitBufHdrUnlocked(BufferDesc *buf) { - SpinDelayStatus delayStatus = init_local_spin_delay(); + SpinDelayStatus delayStatus; uint32 buf_state; + init_local_spin_delay(&delayStatus); + buf_state = pg_atomic_read_u32(&buf->state); while (buf_state & BM_LOCKED) diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c index ddb653a06d7..25eec9800de 100644 --- a/src/backend/storage/lmgr/lwlock.c +++ b/src/backend/storage/lmgr/lwlock.c @@ -870,7 +870,9 @@ LWLockWaitListLock(LWLock *lock) /* and then spin without atomic operations until lock is released */ { - SpinDelayStatus delayStatus = init_local_spin_delay(); + SpinDelayStatus delayStatus; + + init_local_spin_delay(&delayStatus); while (old_state & LW_FLAG_LOCKED) { diff --git a/src/backend/storage/lmgr/s_lock.c b/src/backend/storage/lmgr/s_lock.c index 3902cbf2d96..599940cbd2d 100644 --- a/src/backend/storage/lmgr/s_lock.c +++ b/src/backend/storage/lmgr/s_lock.c @@ -91,7 +91,9 @@ s_lock_stuck(const char *file, int line, const char *func) int s_lock(volatile slock_t *lock, const char *file, int line, const char *func) { - SpinDelayStatus delayStatus = init_spin_delay(file, line, func); + SpinDelayStatus delayStatus; + + init_spin_delay(&delayStatus, file, line, func); while (TAS_SPIN(lock)) { |