![]() |
nsbaci 1.0
|
Counting semaphore for process synchronization. More...
#include <semaphore.h>
Public Member Functions | |
| Semaphore (int32_t initialCount=0) | |
| bool | wait (nsbaci::types::ThreadID currentThread) |
| P operation (wait/decrement). | |
| nsbaci::types::ThreadID | signal () |
| V operation (signal/increment). | |
| int32_t | getCount () const |
| Get current count (for debugging). | |
| bool | hasWaiting () const |
| Check if any threads are blocked. | |
Counting semaphore for process synchronization.
Created at runtime when StoreSemaphore instruction executes.
| nsbaci::types::ThreadID nsbaci::services::runtime::Semaphore::signal | ( | ) |
V operation (signal/increment).
| bool nsbaci::services::runtime::Semaphore::wait | ( | nsbaci::types::ThreadID | currentThread | ) |
P operation (wait/decrement).
| currentThread | The thread attempting to wait |