workqueue: Rework while loop locking
authorBart Van Assche <bvanassche@acm.org>
Sat, 4 Jul 2020 16:39:54 +0000 (09:39 -0700)
committerBart Van Assche <bvanassche@acm.org>
Sat, 4 Jul 2020 16:48:01 +0000 (09:48 -0700)
commit2dddd728bfdc51f08355e13f7f21b224d6b032fd
treea9dfc279eecea93b20bc90998f61f4df0122fd5b
parent0c153a89ce498bf8c9e330165b6971d88ca2b12e
workqueue: Rework while loop locking

Reduce the number of pthread_mutex_lock() and unlock calls by moving
these outside while loops. Other than protecting the all_sw_idle() call with
the wq->flush_lock, this patch does not change any functionality.

Signed-off-by: Bart Van Assche <bvanassche@acm.org>
workqueue.c