From 45e4be0d96abdc729252df1e97bb9a56302e5a4a Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Sat, 15 Aug 2009 09:46:23 +0200 Subject: tevent: add tevent_req_cancel() infrastructure This offers a generic way for callers to cancel an async request. metze --- lib/tevent/tevent.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib/tevent/tevent.h') diff --git a/lib/tevent/tevent.h b/lib/tevent/tevent.h index 56ae0ee082..d3556053ac 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, -- cgit