33#include <condition_variable>
43#define THREADSLEEP(tick) std::this_thread::sleep_for(std::chrono::seconds(tick))
81#define MUTEX_INITIALIZER \
83#define MUTEXINIT(mutex) \
86#define MUTEXDESTROY(mutex) \
93using namespace std::this_thread;
99using Promise = std::promise<Tp>;
100template <
typename Tp>
101using Future = std::future<Tp>;
102template <
typename Tp>
117template <
typename Tp,
typename MutexTp = Mutex,
size_t N = 4>
121 static std::array<MutexTp, N> _mutex_array{};
122 return _mutex_array[_n % N];
G4int(*)(G4Mutex *) thread_unlock
G4int(*)(G4Mutex *) thread_lock
unsigned GetNumberOfCores()
void SetThreadId(int aNewValue)
bool SetPinAffinity(int idx, NativeThread &at)
std::thread::native_handle_type NativeThread
std::recursive_mutex RecursiveMutex
std::promise< Tp > Promise
void * ThreadFunReturnType
MutexTp & TypeMutex(const unsigned int &_n=0)
std::condition_variable Condition
std::shared_future< Tp > SharedFuture