summaryrefslogtreecommitdiff
path: root/source3/utils
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-02-15 16:38:43 +0100
committerVolker Lendecke <vl@samba.org>2012-04-19 22:24:19 +0200
commit1be6d849ab9d2c992dfa94419260fc28cf573d87 (patch)
tree87f20589c0b165353ff365f34b46acb9c46977af /source3/utils
parent1b5b38a61547a48fa7a51bdd634c880264553d36 (diff)
downloadsamba-1be6d849ab9d2c992dfa94419260fc28cf573d87.tar.gz
samba-1be6d849ab9d2c992dfa94419260fc28cf573d87.tar.bz2
samba-1be6d849ab9d2c992dfa94419260fc28cf573d87.zip
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.
Diffstat (limited to 'source3/utils')
-rw-r--r--source3/utils/net_g_lock.c5
1 files changed, 2 insertions, 3 deletions
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;
}