From b7d0bbf11651b03d1fb97f664e12c430d7a43def Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Mon, 7 Dec 2015 10:43:45 -0700 Subject: [PATCH] workqueue: grab sw->lock for flag manipulation For consistency, should not matter in the shutdown path. Signed-off-by: Jens Axboe --- workqueue.c | 2 ++ 1 file changed, 2 insertions(+) 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++; } -- 2.25.1