aboutsummaryrefslogtreecommitdiff
path: root/src/common/workqueue.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/workqueue.c')
-rw-r--r--src/common/workqueue.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/common/workqueue.c b/src/common/workqueue.c
index 3f9a063e11..cf63634076 100644
--- a/src/common/workqueue.c
+++ b/src/common/workqueue.c
@@ -293,10 +293,10 @@ threadpool_queue_work(threadpool_t *pool,
TOR_TAILQ_INSERT_TAIL(&pool->work, ent, next_work);
- tor_mutex_release(&pool->lock);
-
tor_cond_signal_one(&pool->condition);
+ tor_mutex_release(&pool->lock);
+
return ent;
}
@@ -345,10 +345,10 @@ threadpool_queue_update(threadpool_t *pool,
pool->update_fn = fn;
++pool->generation;
- tor_mutex_release(&pool->lock);
-
tor_cond_signal_all(&pool->condition);
+ tor_mutex_release(&pool->lock);
+
if (old_args) {
for (i = 0; i < n_threads; ++i) {
if (old_args[i] && old_args_free_fn)