next up previous contents index
Next: 3.10.8 nx Up: 3.10 Classes Previous: 3.10.6 mq   Contents   Index

Subsections


3.10.7 mtx

The mtx class implements typical mutual exclusion locks. Only one thread can hold a lock at a time, and attempting to attain the lock while already owning it has undefined results.

3.10.7.1 API

void mtx_new(cw_mtx_t *a_mtx):

Input(s):
a_mtx:
Pointer to space for a mtx.
Output(s):
None.
Exception(s):
None.
Description:
Constructor.
void mtx_delete(cw_mtx_t *a_mtx):

Input(s):
a_mtx:
Pointer to a mtx.
Output(s):
None.
Exception(s):
None.
Description:
Destructor.
void mtx_lock(cw_mtx_t *a_mtx):

Input(s):
a_mtx:
Pointer to a mtx.
Output(s):
None.
Exception(s):
None.
Description:
Lock a_mtx.
cw_bool_t mtx_trylock(cw_mtx_t *a_mtx):

Input(s):
a_mtx:
Pointer to a mtx.
Output(s):
retval:
FALSE:
Success.
TRUE:
Failure.
Exception(s):
None.
Description:
Try to lock a_mtx, but return immediately instead of blocking if a_mtx is already locked.
void mtx_unlock(cw_mtx_t *a_mtx):

Input(s):
a_mtx:
Pointer to a mtx.
Output(s):
None.
Exception(s):
None.
Description:
Unlock a_mtx.


next up previous contents index
Next: 3.10.8 nx Up: 3.10 Classes Previous: 3.10.6 mq   Contents   Index
Jason Evans 2002-03-30