mirror of
https://gitlab.torproject.org/tpo/core/tor.git
synced 2024-12-06 19:41:15 +01:00
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.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user