OWLNext 7.0
Borland's Object Windows Library for the modern age
|
Semaphore object aggregator. More...
#include <owl/thread.h>
Classes | |
class | TLock |
Public Types | |
enum | TWaitWhat { WaitAny = false , WaitAll = true } |
enum | { NoWait = 0 , NoLimit = INFINITE } |
Public Member Functions | |
TSemaphoreSet (const TSemaphore *sems[], int size=-1) | |
sems is initial array of sem ptrs, may be 0 to add sems later, size is maximum sems to hold, -1 means count the 0-terminated array Passing (0,-1) is not valid | |
~TSemaphoreSet () | |
void | Add (const TSemaphore &sem) |
void | Remove (const TSemaphore &sem) |
int | GetCount () const |
const TSemaphore * | operator[] (int index) const |
Friends | |
class | TLock |
Semaphore object aggregator.
Used to combine a set of semaphore objects so that they can be waited upon (locked) as a group. The lock can wait for any one, or all of them. The semaphore objects to be aggregated MUST live at least as long as this TSemaphoreSet, as it maintains pointers to them.
owl::TSemaphoreSet::TSemaphoreSet | ( | const TSemaphore * | sems[], |
int | size = -1 ) |
sems is initial array of sem ptrs, may be 0 to add sems later, size is maximum sems to hold, -1 means count the 0-terminated array Passing (0,-1) is not valid
Definition at line 117 of file thread.cpp.
References CONST_CAST.
owl::TSemaphoreSet::~TSemaphoreSet | ( | ) |
Definition at line 139 of file thread.cpp.
void owl::TSemaphoreSet::Add | ( | const TSemaphore & | sem | ) |
Definition at line 145 of file thread.cpp.
|
inline |
void owl::TSemaphoreSet::Remove | ( | const TSemaphore & | sem | ) |
Definition at line 152 of file thread.cpp.
References CHECK.