32#if defined(WIN32) || defined(_WIN32) || defined(WIN64) || defined(_WIN64)
35# include <sys/syscall.h>
36# include <sys/types.h>
49std::atomic_int numActThreads(0);
58 return std::this_thread::get_id();
66 return std::thread::hardware_concurrency();
84 return (ThreadID >= 0);
97#if defined(__linux__) || defined(_AIX)
98 cpu_set_t* aset =
new cpu_set_t;
101 pthread_t& _aT =
static_cast<pthread_t&
>(aT);
102 return (pthread_setaffinity_np(_aT,
sizeof(cpu_set_t), aset) == 0);
114 return numActThreads--;
119 return numActThreads++;
124 return numActThreads.load();
int WorkerThreadLeavesPool()
unsigned GetNumberOfCores()
int WorkerThreadJoinsPool()
void SetThreadId(int aNewValue)
int GetNumberOfRunningWorkerThreads()
bool SetPinAffinity(int idx, NativeThread &at)
std::thread::native_handle_type NativeThread
void ConsumeParameters(Args...)