18 #ifndef ION_PORT_SEMAPHORE_H_
19 #define ION_PORT_SEMAPHORE_H_
21 #if defined(ION_PLATFORM_IOS) || defined(ION_PLATFORM_MAC)
22 #include <dispatch/dispatch.h>
23 #elif defined(ION_PLATFORM_WINDOWS)
30 #include "base/integral_types.h"
31 #include "base/macros.h"
61 bool TimedWaitMs(int64 timeout_in_ms);
65 #if defined(ION_PLATFORM_IOS) || defined(ION_PLATFORM_MAC)
66 dispatch_semaphore_t semaphore_;
67 #elif defined(ION_PLATFORM_WINDOWS)
69 std::atomic<int> value_;
70 #elif defined(ION_PLATFORM_ASMJS)
82 #endif // ION_PORT_SEMAPHORE_H_
A Semaphore enables threads and process synchronization.