OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
owl::TSemaphoreSet Class Reference

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 TSemaphoreoperator[] (int index) const
 

Friends

class TLock
 

Detailed Description

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.

Definition at line 238 of file thread.h.

Member Enumeration Documentation

◆ anonymous enum

Enumerator
NoWait 
NoLimit 

Definition at line 253 of file thread.h.

◆ TWaitWhat

Enumerator
WaitAny 
WaitAll 

Definition at line 252 of file thread.h.

Constructor & Destructor Documentation

◆ TSemaphoreSet()

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.

◆ ~TSemaphoreSet()

owl::TSemaphoreSet::~TSemaphoreSet ( )

Definition at line 139 of file thread.cpp.

Member Function Documentation

◆ Add()

void owl::TSemaphoreSet::Add ( const TSemaphore & sem)

Definition at line 145 of file thread.cpp.

◆ GetCount()

int owl::TSemaphoreSet::GetCount ( ) const
inline

Definition at line 1222 of file thread.h.

◆ operator[]()

const TSemaphore * owl::TSemaphoreSet::operator[] ( int index) const
inline

Definition at line 1227 of file thread.h.

◆ Remove()

void owl::TSemaphoreSet::Remove ( const TSemaphore & sem)

Definition at line 152 of file thread.cpp.

References CHECK.

Friends And Related Symbol Documentation

◆ TLock

friend class TLock
friend

Definition at line 283 of file thread.h.


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