From be9c89379384a261026c8bf517ec3ed651bb171c Mon Sep 17 00:00:00 2001 From: Marat Dukhan Date: Wed, 1 Apr 2020 22:40:00 -0700 Subject: Implementation using Grand Central Dispatch --- src/threadpool-common.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/threadpool-common.h') diff --git a/src/threadpool-common.h b/src/threadpool-common.h index 1a18c60..ba5587e 100644 --- a/src/threadpool-common.h +++ b/src/threadpool-common.h @@ -14,6 +14,23 @@ #endif #endif +#ifndef PTHREADPOOL_USE_GCD + #if defined(__APPLE__) + #define PTHREADPOOL_USE_GCD 1 + #else + #define PTHREADPOOL_USE_GCD 0 + #endif +#endif + +#ifndef PTHREADPOOL_USE_CONDVAR + #if PTHREADPOOL_USE_GCD || PTHREADPOOL_USE_FUTEX + #define PTHREADPOOL_USE_CONDVAR 0 + #else + #define PTHREADPOOL_USE_CONDVAR 1 + #endif +#endif + + /* Number of iterations in spin-wait loop before going into futex/condvar wait */ #define PTHREADPOOL_SPIN_WAIT_ITERATIONS 1000000 -- cgit v1.2.3