aboutsummaryrefslogtreecommitdiff
path: root/src/windows.c
diff options
context:
space:
mode:
authorMarat Dukhan <maratek@gmail.com>2020-04-10 17:16:42 -0700
committerMarat Dukhan <maratek@gmail.com>2020-04-10 17:16:42 -0700
commitddd479bcd8ba87094132ecf438dd76eb08ee3b0d (patch)
treeb10c6742fbc0ea3c83ac014971159360b3933c40 /src/windows.c
parentfa7261344568f86760231591a7158519fd43f382 (diff)
downloadpthreadpool-ddd479bcd8ba87094132ecf438dd76eb08ee3b0d.tar.gz
Replace atomic fetch_sub with decrement_fetch primitive
Decrement-fetch is a closer match to the primitive used in implementation
Diffstat (limited to 'src/windows.c')
-rw-r--r--src/windows.c2
1 files changed, 1 insertions, 1 deletions
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]);
}
}