OnixS C++ CBOE CFE Binary Order Entry (BOE) Handler  1.11.0
API documentation
Semaphore Class Reference

#include <OnixS/CboeCFE/Trading/BOE/Threading/Semaphore.h>

Public Member Functions

 Semaphore (unsigned int count=1)
 
 ~Semaphore ()
 
bool acquire (int timeoutInMs=-1)
 
bool tryAcquire ()
 
void release ()
 

Detailed Description

Semaphore.

Limits number of threads that can access the shared resource simultaneously.

Definition at line 33 of file Semaphore.h.

Constructor & Destructor Documentation

Semaphore ( unsigned int  count = 1)

Constructor.

The state of the semaphore is signaled when its counter is greater than zero and non-signaled when it is zero.

Parameters
countthe counter value.
~Semaphore ( )

Member Function Documentation

bool acquire ( int  timeoutInMs = -1)

Decrements the counter by one.

If the counter is already zero, blocks the thread until the counter becomes greater than zero.

void release ( )

Increments the counter by one.

bool tryAcquire ( )

Tries to decrement the counter by one.

Returns
`false' if the counter is already zero, otherwise - true.

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