87 EL((
ASSAERR,
"Not intended for private semaphores\n"));
91 EL((
ASSAERR,
"Probably an ftok() error by caller\n"));
100 EL((
ASSAERR,
"Permission problem or kernel tables full\n"));
166 EL((
ASSAERR,
"Error on semop (ndcreate)\n"));
179 EL((
ASSAERR,
"Not intended for private semaphores\n"));
183 EL((
ASSAERR,
"Probably an ftok() error by caller\n"));
225 if (
m_id < 0)
return;
281 EL((
ASSAERR,
"Can't have value_ == 0\n"));
297 std::ostringstream
msg;
298 msg <<
"\n\n\tKey.....: ";
304 msg <<
"0x" << std::hex <<
m_key << std::dec;
307 msg <<
"\n\tID......: " <<
m_id <<
"\n\n";
310 msg <<
"\tsemval [0]\tproc counter[1]\tlock [2]\n"
311 <<
"\t----------\t---------------\t--------\n";
319 msg <<
"Semaphore id = -1. No info is available.";
322 DL((
SEM,
"%s\n\n",
msg.str ().c_str ()));
#define Assure_exit(exp_)
Macro that makes program exit if assert fails.
#define EL(X)
A macro for writing error message to the Logger.
#define DL(X)
A macro for writing debug message to the Logger.
#define trace_with_mask(s, m)
trace_with_mask() is used to trace function call chain in C++ program.
Semaphore class provides a simpler and easier interface to System V semaphore system calls.
A wrapper class to provide AutoPtr with reference semantics.
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.
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.
int open(key_t key_)
Open a semaphore that must already exist.
@ SEM
Class Semaphore messages
@ ASSAERR
ASSA and system errors