s3-g_lock: Use dbwrap_record_watch_send/recv
commit1be6d849ab9d2c992dfa94419260fc28cf573d87
authorVolker Lendecke <vl@samba.org>
Wed, 15 Feb 2012 15:38:43 +0000 (15 16:38 +0100)
committerVolker Lendecke <vl@samba.org>
Thu, 19 Apr 2012 20:24:19 +0000 (19 22:24 +0200)
tree87f20589c0b165353ff365f34b46acb9c46977af
parent1b5b38a61547a48fa7a51bdd634c880264553d36
s3-g_lock: Use dbwrap_record_watch_send/recv

This simplifies the g_lock implementation. The new implementation tries to
acquire a lock. If that fails due to a lock conflict, wait for the g_lock
record to change. Upon change, just try again. The old logic had to cope with
pending records and an ugly hack into ctdb itself. As a bonus, we now get a
really clean async g_lock_lock_send/recv that can asynchronously wait for a
global lock. This would have been almost impossible to do without the
dbwrap_record_watch infrastructure.
source3/include/g_lock.h
source3/lib/g_lock.c
source3/utils/net_g_lock.c