]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
add an explanation of how to use ctdb_lockwait()
authorAndrew Tridgell <tridge@samba.org>
Mon, 16 Apr 2007 23:14:52 +0000 (09:14 +1000)
committerAndrew Tridgell <tridge@samba.org>
Mon, 16 Apr 2007 23:14:52 +0000 (09:14 +1000)
(This used to be ctdb commit e0c9844ea6270ff506b0b5906aa6ccfcc3bcce7a)

ctdb/common/ctdb_lockwait.c

index 6d733155e4a130ffa5ae3b4e26e20816472a10e5..304a0a413ea0f992d1dbe950739b25ecf33e9f44 100644 (file)
@@ -59,7 +59,16 @@ static int lockwait_destructor(struct lockwait_handle *h)
        return 0;
 }
 
-
+/*
+  setup a non-blocking chainlock on a tdb record. If this function
+  returns NULL then it could not get the chainlock. Otherwise it
+  returns a opaque handle, and will call callback() once it has
+  managed to get the chainlock. You can cancel it by using talloc_free
+  on the returned handle.
+
+  It is the callers responsibility to unlock the chainlock once
+  acquired
+ */
 struct lockwait_handle *ctdb_lockwait(struct ctdb_db_context *ctdb_db,
                                      TDB_DATA key,
                                      void (*callback)(void *), void *private_data)