ORIGINAL
Loading...
Searching...
No Matches
Public Member Functions | List of all members
original::semaphore< 0 > Class Reference
Collaboration diagram for original::semaphore< 0 >:
Collaboration graph

Public Member Functions

 semaphore ()
 Constructs an unbounded semaphore with count 0.
 
 semaphore (u_integer init_count)
 Constructs an unbounded semaphore with specified initial count.
 
void acquire ()
 Acquires one resource (decrements count)
 
bool tryAcquire ()
 Attempts to acquire one resource without blocking.
 
bool acquireFor (const time::duration &timeout)
 Attempts to acquire one resource with timeout.
 
void release (u_integer increase=1)
 Releases resources (increments count)
 

Constructor & Destructor Documentation

◆ semaphore()

original::semaphore< 0 >::semaphore ( u_integer  init_count)
inlineexplicit

Constructs an unbounded semaphore with specified initial count.

Parameters
init_countInitial semaphore count

Member Function Documentation

◆ acquire()

void original::semaphore< 0 >::acquire ( )
inline

Acquires one resource (decrements count)

Blocks until count > 0, then decrements count by 1

◆ acquireFor()

bool original::semaphore< 0 >::acquireFor ( const time::duration timeout)
inline

Attempts to acquire one resource with timeout.

Parameters
timeoutMaximum duration to wait for resource availability
Returns
true if resource was acquired within timeout, false otherwise

◆ release()

void original::semaphore< 0 >::release ( u_integer  increase = 1)
inline

Releases resources (increments count)

Parameters
increaseNumber of resources to release (default: 1)

Never blocks since there's no maximum count constraint

◆ tryAcquire()

bool original::semaphore< 0 >::tryAcquire ( )
inline

Attempts to acquire one resource without blocking.

Returns
true if resource was acquired, false if count was 0

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