Check the exit flag at the start of the taskqueue loop rather than the end. It
is possible to tear down the taskqueue before the thread has run and the taskqueue loop would sleep forever. Reviewed by: sam MFC after: 1 week
This commit is contained in:
parent
86c2bc49cc
commit
24ef070126
@ -399,10 +399,10 @@ taskqueue_thread_loop(void *arg)
|
||||
tqp = arg;
|
||||
tq = *tqp;
|
||||
TQ_LOCK(tq);
|
||||
do {
|
||||
while ((tq->tq_flags & TQ_FLAGS_ACTIVE) != 0) {
|
||||
taskqueue_run(tq);
|
||||
TQ_SLEEP(tq, tq, &tq->tq_mutex, 0, "-", 0);
|
||||
} while ((tq->tq_flags & TQ_FLAGS_ACTIVE) != 0);
|
||||
};
|
||||
|
||||
/* rendezvous with thread that asked us to terminate */
|
||||
tq->tq_tcount--;
|
||||
|
Loading…
x
Reference in New Issue
Block a user