1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- #pragma once
- #include "CappedSemaphore.h"
- namespace baselib
- {
- BASELIB_CPP_INTERFACE
- {
-
-
-
-
-
-
-
-
-
-
-
-
-
- class BinarySemaphore : private CappedSemaphore
- {
- public:
-
-
-
-
-
-
- BinarySemaphore() : CappedSemaphore(1) {}
- using CappedSemaphore::Acquire;
- using CappedSemaphore::TryAcquire;
- using CappedSemaphore::TryTimedAcquire;
-
-
-
-
-
-
- inline bool Release()
- {
- return CappedSemaphore::Release(1) == 1;
- }
- };
- }
- }
|