aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/backend/storage/lmgr/lwlock.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c
index 9fe6855945b..bcec17335b8 100644
--- a/src/backend/storage/lmgr/lwlock.c
+++ b/src/backend/storage/lmgr/lwlock.c
@@ -1005,6 +1005,12 @@ LWLockWaitForVar(LWLock *lock, uint64 *valptr, uint64 oldval, uint64 *newval)
lock->tail = proc;
lock->head = proc;
+ /*
+ * Set releaseOK, to make sure we get woken up as soon as the lock is
+ * released.
+ */
+ lock->releaseOK = true;
+
/* Can release the mutex now */
SpinLockRelease(&lock->mutex);