diff options
author | Nick Mathewson <nickm@torproject.org> | 2013-09-24 16:57:40 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-01-14 10:56:27 -0500 |
commit | c7eebe237ddf0555a99b2ef10fd95def2a4bbbd4 (patch) | |
tree | 24b4d28c2bde4029925705e85f4abf3ba0256be4 /src/common/workqueue.h | |
parent | a82604b526a2a258e057d6d515ac17429eb6fb67 (diff) | |
download | tor-c7eebe237ddf0555a99b2ef10fd95def2a4bbbd4.tar.gz tor-c7eebe237ddf0555a99b2ef10fd95def2a4bbbd4.zip |
Make pending work cancellable.
Diffstat (limited to 'src/common/workqueue.h')
-rw-r--r-- | src/common/workqueue.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/common/workqueue.h b/src/common/workqueue.h index e502734b84..47753cff12 100644 --- a/src/common/workqueue.h +++ b/src/common/workqueue.h @@ -8,20 +8,20 @@ typedef struct replyqueue_s replyqueue_t; typedef struct threadpool_s threadpool_t; - +typedef struct workqueue_entry_s workqueue_entry_t; #define WQ_CMD_RUN 0 #define WQ_CMD_CANCEL 1 -#define WQ_RPL_QUEUE 0 -#define WQ_RPL_NOQUEUE 1 -#define WQ_RPL_ERROR 2 -#define WQ_RPL_SHUTDOWN 3 +#define WQ_RPL_REPLY 0 +#define WQ_RPL_ERROR 1 +#define WQ_RPL_SHUTDOWN 2 -void *threadpool_queue_work(threadpool_t *pool, - int (*fn)(int, void *, void *), - void (*reply_fn)(void *), - void *arg); +workqueue_entry_t *threadpool_queue_work(threadpool_t *pool, + int (*fn)(void *, void *), + void (*reply_fn)(void *), + void *arg); +int workqueue_entry_cancel(workqueue_entry_t *pending_work); int threadpool_start_threads(threadpool_t *pool, int n); threadpool_t *threadpool_new(int n_threads, replyqueue_t *replyqueue, |