From ddd479bcd8ba87094132ecf438dd76eb08ee3b0d Mon Sep 17 00:00:00 2001 From: Marat Dukhan Date: Fri, 10 Apr 2020 17:16:42 -0700 Subject: Replace atomic fetch_sub with decrement_fetch primitive Decrement-fetch is a closer match to the primitive used in implementation --- src/windows.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/windows.c') diff --git a/src/windows.c b/src/windows.c index 2bea3bc..144da9d 100644 --- a/src/windows.c +++ b/src/windows.c @@ -27,7 +27,7 @@ static void checkin_worker_thread(struct pthreadpool* threadpool, uint32_t event_index) { - if (pthreadpool_fetch_sub_relaxed_size_t(&threadpool->active_threads, 1) == 1) { + if (pthreadpool_decrement_fetch_relaxed_size_t(&threadpool->active_threads) == 0) { SetEvent(threadpool->completion_event[event_index]); } } -- cgit v1.2.3