92 static constexpr
int kInfinite{-1};
118 bool acquire(
size_t n = 1,
int timeout_ms = kInfinite) noexcept;
129 void release(
size_t n = 1) noexcept;
140 void reset(
bool interrupt_waiters = false) noexcept;
151 [[nodiscard]]
size_t get_count() const noexcept;
155 std::unique_ptr<Impl> impl_;
In-process counting semaphore with an optional acquire timeout.
Definition: semaphore.h:87
Semaphore(size_t count=0) noexcept
Constructs a semaphore with the given initial permit count.
Cross-platform macros for visibility, branch hints, copy prevention, singletons and string helpers.
#define VLINK_EXPORT
Definition: macros.h:81
#define VLINK_DISALLOW_COPY_AND_ASSIGN(classname)
Deletes the copy constructor and copy-assignment operator of classname.
Definition: macros.h:174