From 96ae658e6238c5e69819fb1557c2c14a555506d8 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Sun, 21 Mar 2021 08:02:30 +0100 Subject: [PATCH] Move lwlock-release probe back where it belongs The documentation specifically states that lwlock-release fires before any released waiters have been awakened. It worked that way until ab5194e6f617a9a9e7aadb3dd1cee948a42d0755, where is seems to have been misplaced accidentally. Move it back where it belongs. Author: Craig Ringer Discussion: https://www.postgresql.org/message-id/CAGRY4nwxKUS_RvXFW-ugrZBYxPFFM5kjwKT5O+0+Stuga5b4+Q@mail.gmail.com --- src/backend/storage/lmgr/lwlock.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/backend/storage/lmgr/lwlock.c b/src/backend/storage/lmgr/lwlock.c index adf19aba75..975d547f34 100644 --- a/src/backend/storage/lmgr/lwlock.c +++ b/src/backend/storage/lmgr/lwlock.c @@ -1840,6 +1840,7 @@ LWLockRelease(LWLock *lock) /* nobody else can have that kind of lock */ Assert(!(oldstate & LW_VAL_EXCLUSIVE)); + TRACE_POSTGRESQL_LWLOCK_RELEASE(T_NAME(lock)); /* * We're still waiting for backends to get scheduled, don't wake them up @@ -1863,8 +1864,6 @@ LWLockRelease(LWLock *lock) LWLockWakeup(lock); } - TRACE_POSTGRESQL_LWLOCK_RELEASE(T_NAME(lock)); - /* * Now okay to allow cancel/die interrupts. */