3 #ifndef INCLUDE_NN_NLIB_THREADING_SEMAPHORE_H_
4 #define INCLUDE_NN_NLIB_THREADING_SEMAPHORE_H_
34 NativeHandle GetNativeHandle()
NLIB_NOEXCEPT {
return &m_Obj; }
46 class ScopedSemaphore {
50 m_Semaphore.Acquire();
53 m_Semaphore.Release(NULL);
57 Semaphore& m_Semaphore;
64 #endif // INCLUDE_NN_NLIB_THREADING_SEMAPHORE_H_
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
#define NLIB_DISALLOW_COPY_AND_ASSIGN(TypeName)
Prohibits use of the copy constructor and assignment operator for the class specified by TypeName...
errno_t TryAcquire(const nlib_ns::TimeSpan &timeout) noexcept
Locks one semaphore with timeout.
errno_t Init(int initialCount) noexcept
Initializes the semaphore.
Defines the class for handling times and durations.
A file that contains the configuration information for each development environment.
errno_t TryAcquire() noexcept
Tries to lock a semaphore.
The class for representing the time.
errno_t Release(int *previousCount) noexcept
Releases one semaphore.
errno_t Release(int releaseCount, int *previousCount) noexcept
Releases multiple semaphores. May not be executed atomically.
errno_t Acquire() noexcept
Locks one semaphore.