Semaphore Class Reference

Semaphore class. More...

List of all members.

Public Member Functions

bool Down (simba_uint32 in_msTimeout) const
 Decreases the semaphore count.
bool Down () const
 Decreases the semaphore count.
 Semaphore (simba_uint32 in_initialValue)
 Construct a semaphore with a specified initial value.
 Semaphore ()
 Construct a semaphore with initial value 0.
bool TryDown () const
 Attempts to lock the semaphore, only if the semaphore is currently not locked.
void Up () const
 Increases the semaphore count.
 ~Semaphore ()
 Destructor.

Static Public Attributes

static const simba_uint32 SEMAPHORE_MAX_VALUE
 Platform specific maximum value for a semaphore.

Detailed Description

Semaphore class.


Constructor & Destructor Documentation

Semaphore (  ) 

Construct a semaphore with initial value 0.

Semaphore ( simba_uint32  in_initialValue  ) 

Construct a semaphore with a specified initial value.

Parameters:
in_initialValue Value to initialize the semaphore with.
Exceptions:
SupportException if in_initialValue is greater than SEMAPHORE_MAX_VALUE.
~Semaphore (  ) 

Destructor.


Member Function Documentation

bool Down ( simba_uint32  in_msTimeout  )  const

Decreases the semaphore count.

If the count is 0, this blocks the current thread until another thread calls Up() or the timeout expires.

Parameters:
in_msTimeout Timeout in milliseconds to wait for before giving up.
Returns:
Returns true if the semaphore value was decreased. False if the timeout expired.
bool Down (  )  const

Decreases the semaphore count.

If the count is 0, this blocks the current thread until another thread calls Up().

Returns:
Always returns true indicating the semaphore value was decreased. This will block indefinitely until then.
bool TryDown (  )  const

Attempts to lock the semaphore, only if the semaphore is currently not locked.

Returns:
Returns true if the semaphore value was decreased, false otherwise.
void Up (  )  const

Increases the semaphore count.

If one or more threads are blocked on a Down() call, one of them will be unblocked.

Exceptions:
SupportException if the current value of the semaphore is already at SEMAPHORE_MAX_VALUE.

Member Data Documentation

Platform specific maximum value for a semaphore.


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

Generated on Wed May 17 14:21:19 2017 for SimbaEngine 10.1.3.1011 by simba