From 1be6d849ab9d2c992dfa94419260fc28cf573d87 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Wed, 15 Feb 2012 16:38:43 +0100 Subject: 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/utils/net_g_lock.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/net_g_lock.c b/source3/utils/net_g_lock.c index b9d99160bc..e51a1ae28d 100644 --- a/source3/utils/net_g_lock.c +++ b/source3/utils/net_g_lock.c @@ -114,9 +114,8 @@ static int net_g_lock_dump_fn(struct server_id pid, enum g_lock_type lock_type, char *pidstr; pidstr = server_id_str(talloc_tos(), &pid); - d_printf("%s: %s (%s)\n", pidstr, - (lock_type & 1) ? "WRITE" : "READ", - (lock_type & G_LOCK_PENDING) ? "pending" : "holder"); + d_printf("%s: %s\n", pidstr, + (lock_type & 1) ? "WRITE" : "READ"); TALLOC_FREE(pidstr); return 0; } -- cgit