mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
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
1 changed files with 2 additions and 2 deletions
|
|
@ -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…
Reference in a new issue