diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c index 5453549a792..1607bc9e536 100644 --- a/src/backend/storage/lmgr/lwlock.c +++ b/src/backend/storage/lmgr/lwlock.c @@ -976,6 +976,12 @@ LWLockWaitForVar(LWLock *l, 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);