s3:g_lock: try to keep the watch instance during g_lock_watch_data()
authorStefan Metzmacher <metze@samba.org>
Sun, 26 Jun 2022 16:16:38 +0000 (16:16 +0000)
committerRalph Boehme <slow@samba.org>
Tue, 26 Jul 2022 13:40:34 +0000 (13:40 +0000)
commite33143099b37a4d79a1cd45ca43a5a5d9d63b261
tree9f83ee9a674e27db26c91794993e5740d58a5690
parent20f3fd021911a118228815cb32d436069b0273d1
s3:g_lock: try to keep the watch instance during g_lock_watch_data()

Unless the unique_lock_epoch changes via g_lock_lock()/g_lock_unlock()
we try to keep our existing watch instance alive while waiting
for unique_data_epoch to change.

This will become important in the following commits when the
dbwrap_watch layer will only wake up one watcher at a time
and each woken watcher will wakeup the next one. Without this
commit we would trigger an endless loop as none of the watchers
will ever change unique_data_epoch.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15125

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/lib/g_lock.c