35 [[nodiscard]] std::string_view
name() const noexcept override;
38 [[nodiscard]] std::
size_t count() const noexcept;
41 [[nodiscard]] std::
size_t maxCount() const noexcept;
Common interface for synchronization primitives.
A result type that holds either a success value of type T or an ErrorCode.
Result< void > release(ProcessId pid) override
Releases one semaphore unit.
std::string_view name() const noexcept override
Primitive name for diagnostics.
std::size_t count() const noexcept
Current available count.
Semaphore(std::size_t initialCount=1, std::size_t maxCount=1)
Constructs semaphore with initial and maximum count.
Semaphore(const Semaphore &)=delete
std::unique_ptr< Impl > impl_
Result< void > tryAcquire(ProcessId pid) override
Non-blocking acquire attempt.
Result< void > acquire(ProcessId pid) override
Acquires one semaphore unit.
std::size_t waitingCount() const noexcept
Number of waiting processes.
Semaphore & operator=(const Semaphore &)=delete
Semaphore(Semaphore &&) noexcept
std::size_t maxCount() const noexcept
Configured maximum count.
ISyncPrimitive interface for synchronization objects.
std::uint32_t ProcessId
Unique identifier for a process.