![]() |
Contur 2
Educational OS kernel simulator
|
Counting semaphore synchronization primitive. More...
#include <semaphore.h>
Public Member Functions | |
| Semaphore (std::size_t initialCount=1, std::size_t maxCount=1) | |
| Constructs semaphore with initial and maximum count. | |
| ~Semaphore () override | |
| Destroys semaphore. | |
| Semaphore (const Semaphore &)=delete | |
| Copy construction is disabled. | |
| Semaphore & | operator= (const Semaphore &)=delete |
| Copy assignment is disabled. | |
| Semaphore (Semaphore &&) noexcept | |
| Move-constructs semaphore state. | |
| Semaphore & | operator= (Semaphore &&) noexcept |
| Move-assigns semaphore state. | |
| Result< void > | acquire (ProcessId pid) override |
| Acquires one semaphore unit. | |
| Result< void > | release (ProcessId pid) override |
| Releases one semaphore unit. | |
| Result< void > | tryAcquire (ProcessId pid) override |
| Non-blocking acquire attempt. | |
| std::string_view | name () const noexcept override |
| Primitive name for diagnostics. | |
| SyncLayer | layer () const noexcept override |
| Layer classification for synchronization model split. | |
| Result< void > | registerProcessPriority (ProcessId pid, PriorityLevel basePriority) |
| Registers process base priority used for boost rules. | |
| PriorityLevel | effectivePriority (ProcessId pid) const noexcept |
| Effective priority after inheritance boosts. | |
| PriorityLevel | basePriority (ProcessId pid) const noexcept |
| Registered base priority. | |
| std::size_t | count () const noexcept |
| Current available count. | |
| std::size_t | maxCount () const noexcept |
| Configured maximum count. | |
| std::size_t | waitingCount () const noexcept |
| Number of waiting processes. | |
| Public Member Functions inherited from contur::ISyncPrimitive | |
| virtual | ~ISyncPrimitive ()=default |
Private Attributes | |
| std::unique_ptr< Impl > | impl_ |
Counting semaphore synchronization primitive.
Definition at line 14 of file semaphore.h.
|
explicit |
Constructs semaphore with initial and maximum count.
References maxCount().
Referenced by operator=(), operator=(), Semaphore(), and Semaphore().
|
override |
Destroys semaphore.
|
delete |
Copy construction is disabled.
References Semaphore().
|
noexcept |
Move-constructs semaphore state.
References Semaphore().
Acquires one semaphore unit.
Implements contur::ISyncPrimitive.
References acquire().
Referenced by acquire().
|
nodiscardnoexcept |
Registered base priority.
References basePriority().
Referenced by basePriority(), and registerProcessPriority().
|
nodiscardnoexcept |
|
nodiscardnoexcept |
Effective priority after inheritance boosts.
References effectivePriority().
Referenced by effectivePriority().
|
nodiscardoverridevirtualnoexcept |
Layer classification for synchronization model split.
Implements contur::ISyncPrimitive.
References layer().
Referenced by layer().
|
nodiscardnoexcept |
|
nodiscardoverridevirtualnoexcept |
Primitive name for diagnostics.
Implements contur::ISyncPrimitive.
References name().
Referenced by name().
Copy assignment is disabled.
References Semaphore().
Move-assigns semaphore state.
References Semaphore().
|
nodiscard |
Registers process base priority used for boost rules.
References basePriority(), and registerProcessPriority().
Referenced by registerProcessPriority().
Releases one semaphore unit.
Implements contur::ISyncPrimitive.
References release().
Referenced by release().
Non-blocking acquire attempt.
Implements contur::ISyncPrimitive.
References tryAcquire().
Referenced by tryAcquire().
|
nodiscardnoexcept |
|
private |
Definition at line 69 of file semaphore.h.