BmnRoot
Loading...
Searching...
No Matches
Semaphore Class Reference

Public Member Functions

 Semaphore (unsigned int resource_count=0)
 
void acquire ()
 Acquires a resource from the semaphore.
 
void release ()
 Releases a resource from the semaphore.
 

Detailed Description

Definition at line 73 of file nica-scheduler.cpp.

Constructor & Destructor Documentation

◆ Semaphore()

Semaphore::Semaphore ( unsigned int  resource_count = 0)
inline

Definition at line 76 of file nica-scheduler.cpp.

Member Function Documentation

◆ acquire()

void Semaphore::acquire ( )
inline

Acquires a resource from the semaphore.

Decrements the internal resource count. If the count is zero, the calling thread will block until another thread releases a resource by calling release().

Definition at line 87 of file nica-scheduler.cpp.

◆ release()

void Semaphore::release ( )
inline

Releases a resource from the semaphore.

Increments the internal resource count. If a thread is waiting for a resource to be released, it will be notified.

Definition at line 100 of file nica-scheduler.cpp.


The documentation for this class was generated from the following file: