summaryrefslogtreecommitdiffstats
path: root/lib/tevent/tevent.h
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-08-15 09:46:23 +0200
committerStefan Metzmacher <metze@samba.org>2009-08-17 09:25:44 +0200
commit45e4be0d96abdc729252df1e97bb9a56302e5a4a (patch)
treea9bcfc8d68dee0b58d6534029c9012733b588484 /lib/tevent/tevent.h
parent26e114b83ce1de7515bfbf365da03ec3f18c95fd (diff)
downloadsamba-45e4be0d96abdc729252df1e97bb9a56302e5a4a.tar.gz
samba-45e4be0d96abdc729252df1e97bb9a56302e5a4a.tar.xz
samba-45e4be0d96abdc729252df1e97bb9a56302e5a4a.zip
tevent: add tevent_req_cancel() infrastructure
This offers a generic way for callers to cancel an async request. metze
Diffstat (limited to 'lib/tevent/tevent.h')
-rw-r--r--lib/tevent/tevent.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/tevent/tevent.h b/lib/tevent/tevent.h
index 56ae0ee0820..d3556053acc 100644
--- a/lib/tevent/tevent.h
+++ b/lib/tevent/tevent.h
@@ -238,6 +238,14 @@ char *tevent_req_default_print(struct tevent_req *req, TALLOC_CTX *mem_ctx);
char *tevent_req_print(TALLOC_CTX *mem_ctx, struct tevent_req *req);
+typedef bool (*tevent_req_cancel_fn)(struct tevent_req *);
+
+void tevent_req_set_cancel_fn(struct tevent_req *req, tevent_req_cancel_fn fn);
+
+bool _tevent_req_cancel(struct tevent_req *req, const char *location);
+#define tevent_req_cancel(req) \
+ _tevent_req_cancel(req, __location__)
+
struct tevent_req *_tevent_req_create(TALLOC_CTX *mem_ctx,
void *pstate,
size_t state_size,