From: Jens Axboe Date: Mon, 7 Dec 2015 17:43:45 +0000 (-0700) Subject: workqueue: grab sw->lock for flag manipulation X-Git-Tag: fio-2.2.13~42 X-Git-Url: https://git.kernel.dk/?p=fio.git;a=commitdiff_plain;h=b7d0bbf11651b03d1fb97f664e12c430d7a43def workqueue: grab sw->lock for flag manipulation For consistency, should not matter in the shutdown path. Signed-off-by: Jens Axboe --- diff --git a/workqueue.c b/workqueue.c index 7cd83bfd..27570b2a 100644 --- a/workqueue.c +++ b/workqueue.c @@ -388,7 +388,9 @@ void workqueue_exit(struct workqueue *wq) sw = &wq->workers[i]; if (sw->flags & SW_F_ACCOUNTED) continue; + pthread_mutex_lock(&sw->lock); sw->flags |= SW_F_ACCOUNTED; + pthread_mutex_unlock(&sw->lock); shutdown_worker(sw, &sum_cnt); shutdown++; }