39 void Release(
uint inNumber = 1);
42 void Acquire(
uint inNumber = 1);
45 inline int GetValue()
const {
return mCount.load(std::memory_order_relaxed); }
48#if defined(JPH_PLATFORM_WINDOWS) || defined(JPH_USE_PTHREADS) || defined(JPH_USE_GRAND_CENTRAL_DISPATCH) || defined(JPH_PLATFORM_BLUE)
49#ifdef JPH_PLATFORM_WINDOWS
50 using SemaphoreType =
void *;
51#elif defined(JPH_USE_PTHREADS)
52 using SemaphoreType = sem_t;
53#elif defined(JPH_USE_GRAND_CENTRAL_DISPATCH)
54 using SemaphoreType = dispatch_semaphore_t;
55#elif defined(JPH_PLATFORM_BLUE)
56 using SemaphoreType = JPH_PLATFORM_BLUE_SEMAPHORE;
59 SemaphoreType mSemaphore { };
63 std::condition_variable mWaitVariable;
64 atomic<int> mCount { 0 };