Skip to content

timed_semaphore timed_semaphore

Alairion edited this page May 8, 2021 · 2 revisions

nes::timed_semaphore::timed_semaphore

Functions

(1) explicit timed_semaphore(std::size_t initial_count = 0);
(2) timed_semaphore(const timed_semaphore&) = delete;
(3) timed_semaphore(timed_semaphore&& other) noexcept = delete;
  1. Constructs a new timed semaphore object with initial_count resources available.
  2. Deleted copy-constructor.
  3. Deleted move-constructor.

Parameters

Name Description
initial_count The count of resources available right after construction. The default value is 0

Complexity

  1. Explicit.

Exceptions

  1. May throw a std::runtime_error if the timed_semaphore can not be created.
  2. Deleted.
  3. Deleted.

Implementation details

  1. On Windows, the timed_semaphore is created using Createtimed_semaphoreW
    On Posix systems, the timed_semaphore is created using sem_init
Clone this wiki locally