summaryrefslogtreecommitdiffstats
path: root/ctdb/common/ctdb_lockwait.c
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2007-04-17 09:14:52 +1000
committerAndrew Tridgell <tridge@samba.org>2007-04-17 09:14:52 +1000
commita024989597444aabc3a44da99c5e6828236cba3f (patch)
tree7c70c2f7f864299cf71ae2206dfd1a72b8b10866 /ctdb/common/ctdb_lockwait.c
parent7db4320e84bae58abc4e2fe7549c821d3b564aed (diff)
downloadsamba-a024989597444aabc3a44da99c5e6828236cba3f.tar.gz
samba-a024989597444aabc3a44da99c5e6828236cba3f.tar.xz
samba-a024989597444aabc3a44da99c5e6828236cba3f.zip
add an explanation of how to use ctdb_lockwait()
(This used to be ctdb commit e0c9844ea6270ff506b0b5906aa6ccfcc3bcce7a)
Diffstat (limited to 'ctdb/common/ctdb_lockwait.c')
-rw-r--r--ctdb/common/ctdb_lockwait.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/ctdb/common/ctdb_lockwait.c b/ctdb/common/ctdb_lockwait.c
index 6d733155e4..304a0a413e 100644
--- a/ctdb/common/ctdb_lockwait.c
+++ b/ctdb/common/ctdb_lockwait.c
@@ -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)