16 #ifndef INCLUDE_NN_NLIB_THREADING_SEMAPHORE_H_ 17 #define INCLUDE_NN_NLIB_THREADING_SEMAPHORE_H_ 47 NativeHandle GetNativeHandle()
NLIB_NOEXCEPT {
return &obj_; }
60 class ScopedSemaphore {
67 semaphore_.Release(
nullptr);
78 #endif // INCLUDE_NN_NLIB_THREADING_SEMAPHORE_H_
#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 Release(int *previous_count) noexcept
Releases one semaphore.
errno_t Release(int release_count, int *previous_count) noexcept
Releases multiple semaphores. May not be executed atomically.
errno_t Init(int initial_count) noexcept
Initializes the semaphore.
Defines the class for handling times and durations.
#define NLIB_NOEXCEPT
Defines noexcept geared to the environment, or the equivalent.
A file that contains the configuration information for each development environment.
errno_t TryAcquire() noexcept
Tries to lock a semaphore.
#define NLIB_FINAL
Defines final if it is available for use. If not, holds an empty string.
The class for representing the time.
errno_t Acquire() noexcept
Locks one semaphore.