Go to the documentation of this file.
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;
void close()
Close a semaphore.
key_t m_key
Semaphore's key.
void init()
Initalize by invalidating data members.
static sembuf m_op_open[2]
Decrement process counter with undo on exit.
void signal()
Increment a semaphore by 1.
static sembuf m_op_close[3]
Wait for lock to equal 0, then increment lock to 1 (lock it), then increment process counter.
void remove()
Remove a semaphore.
static sembuf m_op_endcreate[2]
Decrement process counter with undo on exit, then decrement lock back to 0.
static sembuf m_op_op[1]
Decrement or increment semaphore with undo on exit.
int create(key_t key_, int initval_=1)
Create a semaphore with a specified initial value.
key_t key() const
Get key.
void op(int val_)
General semaphore operation.
virtual ~Semaphore()
Destructor.
void dump(void) const
Dump the objects state along with the state of the semaphore (if connected) to the log file.
int open(key_t key_)
Open a semaphore that must already exist.
static const int BIGCOUNT
@ SEM
Class Semaphore messages
static sembuf m_op_unlock[1]
Decremetn lock back to 0.
static sembuf m_op_lock[2]
Wait for lock to equal 0, then increment lock to 1 - this locks it.
void wait()
Wait until a semaphore's value is greater then 0, then decrement it by 1 and return.
#define trace_with_mask(s, m)