20 #include <sys/types.h>
83 int create (key_t key_,
int initval_ = 1);
94 int open (key_t key_);
142 void dump (
void)
const;
A collection of assert function wrappers.
#define trace_with_mask(s, m)
trace_with_mask() is used to trace function call chain in C++ program.
static sembuf m_op_open[2]
Decrement process counter with undo on exit.
void remove()
Remove a semaphore.
int create(key_t key_, int initval_=1)
Create a semaphore with a specified initial value.
void init()
Initalize by invalidating data members.
static sembuf m_op_op[1]
Decrement or increment semaphore with undo on exit.
static sembuf m_op_unlock[1]
Decremetn lock back to 0.
static sembuf m_op_close[3]
Wait for lock to equal 0, then increment lock to 1 (lock it), then increment process counter.
key_t m_key
Semaphore's key.
void op(int val_)
General semaphore operation.
virtual ~Semaphore()
Destructor.
static sembuf m_op_lock[2]
Wait for lock to equal 0, then increment lock to 1 - this locks it.
static const int BIGCOUNT
void dump(void) const
Dump the objects state along with the state of the semaphore (if connected) to the log file.
static sembuf m_op_endcreate[2]
Decrement process counter with undo on exit, then decrement lock back to 0.
void close()
Close a semaphore.
void wait()
Wait until a semaphore's value is greater then 0, then decrement it by 1 and return.
key_t key() const
Get key.
int open(key_t key_)
Open a semaphore that must already exist.
void signal()
Increment a semaphore by 1.
@ SEM
Class Semaphore messages