aboutsummaryrefslogtreecommitdiff
path: root/src/common/workqueue.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-12-16 10:20:40 -0500
committerNick Mathewson <nickm@torproject.org>2015-01-14 11:31:14 -0500
commit051ad788e0ebcd0c99c1498e7e45faa71c4830c1 (patch)
tree78407824db1373cd6ed28fc394234cc7f65f1beb /src/common/workqueue.c
parentfb5ebfb50770062c77534d4db4c6a9c5ad475fa0 (diff)
downloadtor-051ad788e0ebcd0c99c1498e7e45faa71c4830c1.tar.gz
tor-051ad788e0ebcd0c99c1498e7e45faa71c4830c1.zip
Incorporate some comments based on notes from dgoulet
Diffstat (limited to 'src/common/workqueue.c')
-rw-r--r--src/common/workqueue.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/common/workqueue.c b/src/common/workqueue.c
index f3ef67891d..7fa8967580 100644
--- a/src/common/workqueue.c
+++ b/src/common/workqueue.c
@@ -69,9 +69,10 @@ typedef struct workerthread_s {
tor_cond_t condition;
/** Queue of pending work that we have to do. */
TOR_TAILQ_HEAD(, workqueue_entry_s) work;
- /** True iff this thread is currently in its loop. */
+ /** True iff this thread is currently in its loop. (Not currently used.) */
unsigned is_running;
- /** True iff this thread has crashed or is shut down for some reason. */
+ /** True iff this thread has crashed or is shut down for some reason. (Not
+ * currently used.) */
unsigned is_shut_down;
/** True if we're waiting for more elements to get added to the queue. */
unsigned waiting;
@@ -190,6 +191,7 @@ worker_thread_main(void *thread_)
/* TODO: support an idle-function */
/* Okay. Now, wait till somebody has work for us. */
+ /* XXXX we could just omit waiting and instead */
thread->waiting = 1;
if (tor_cond_wait(&thread->condition, &thread->lock, NULL) < 0) {
/* XXXX ERROR */