diff options
author | Marat Dukhan <maratek@gmail.com> | 2020-04-01 22:40:00 -0700 |
---|---|---|
committer | Marat Dukhan <maratek@gmail.com> | 2020-04-01 22:40:00 -0700 |
commit | be9c89379384a261026c8bf517ec3ed651bb171c (patch) | |
tree | aad41dc2cd010ac96e053b940a7b3bf31ecd4be5 /src/threadpool-common.h | |
parent | 23bc8d1e42d73e5df79bba61048b8da9bf14c194 (diff) | |
download | pthreadpool-be9c89379384a261026c8bf517ec3ed651bb171c.tar.gz |
Implementation using Grand Central Dispatch
Diffstat (limited to 'src/threadpool-common.h')
-rw-r--r-- | src/threadpool-common.h | 17 |
1 files changed, 17 insertions, 0 deletions
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 |