summaryrefslogtreecommitdiff
path: root/source3/lib/g_lock.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/lib/g_lock.c')
-rw-r--r--source3/lib/g_lock.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source3/lib/g_lock.c b/source3/lib/g_lock.c
index 07958f30b5e..7e3ecf664f8 100644
--- a/source3/lib/g_lock.c
+++ b/source3/lib/g_lock.c
@@ -441,6 +441,8 @@ static NTSTATUS g_lock_trylock(
return NT_STATUS_WAS_LOCKED;
}
+ g_lock_cleanup_shared(&lck);
+
if (lck.num_shared != 0) {
g_lock_get_shared(&lck, 0, blocker);
@@ -494,6 +496,8 @@ noexclusive:
lck.exclusive = self;
+ g_lock_cleanup_shared(&lck);
+
status = g_lock_store(rec, &lck, NULL, NULL, 0);
if (!NT_STATUS_IS_OK(status)) {
DBG_DEBUG("g_lock_store() failed: %s\n",