diff options
author | Nick Mathewson <nickm@torproject.org> | 2015-01-14 13:29:58 -0500 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2015-01-15 11:05:22 -0500 |
commit | a52e549124adb09ad0b49b7d2b5b3fb79bfe7aeb (patch) | |
tree | f3a05f531148dc00fc68be10d12c9ebffefb035d /src/common/workqueue.h | |
parent | 051ad788e0ebcd0c99c1498e7e45faa71c4830c1 (diff) | |
download | tor-a52e549124adb09ad0b49b7d2b5b3fb79bfe7aeb.tar.gz tor-a52e549124adb09ad0b49b7d2b5b3fb79bfe7aeb.zip |
Update workqueue implementation to use a single queue for the work
Previously I used one queue per worker; now I use one queue for
everyone. The "broadcast" code is gone, replaced with an idempotent
'update' operation.
Diffstat (limited to 'src/common/workqueue.h')
-rw-r--r-- | src/common/workqueue.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/common/workqueue.h b/src/common/workqueue.h index aa1bcc518a..92e82b8a48 100644 --- a/src/common/workqueue.h +++ b/src/common/workqueue.h @@ -27,11 +27,11 @@ workqueue_entry_t *threadpool_queue_work(threadpool_t *pool, int (*fn)(void *, void *), void (*reply_fn)(void *), void *arg); -int threadpool_queue_for_all(threadpool_t *pool, - void *(*dup_fn)(void *), - int (*fn)(void *, void *), - void (*reply_fn)(void *), - void *arg); +int threadpool_queue_update(threadpool_t *pool, + void *(*dup_fn)(void *), + int (*fn)(void *, void *), + void (*free_fn)(void *), + void *arg); void *workqueue_entry_cancel(workqueue_entry_t *pending_work); threadpool_t *threadpool_new(int n_threads, replyqueue_t *replyqueue, |