FairCom Corporation


F.64 ctThrdMutexGet


Acquires a mutex.

Short Name

ctThrdMutexGet

TYPE

Threading function

DECLARATION

NINT ctThrdMutexGet(pctMUTEX mutex)

DESCRIPTION

A mutex is the most simple, efficient synchronization object supported by this API. A mutex must be released by the same thread that acquired it. ctThrdMutexGet waits indefinitely to acquire the mutex. Only one thread can acquire a mutex at a time. The argument to ctThrdMutexGet is the address of a mutex object of type ctMUTEX.

RETURN

On error, check sysiocod for the system level error return.

Value
Symbolic Constant
Explanation
0
NO_ERROR
Successful function.
636
TSYF_ERR
mutex get failed.

See Appendix A "c-tree Plus Error Codes" of the c-tree Plus Programmer's Reference Guide for a complete listing of valid c-tree Plus error values.

EXAMPLE

ctMUTEX tfin_mtx;
NINT rc;
ctThrdMutexGet(&tfin_mtx);
rc = tfin;
ctThrdMutexRel(&tfin_mtx);

LIMITATIONS

Can only be used with a ctThrd library.

SEE ALSO

ctThrdMutexTry and ctThrdMutexRel.


FairCom Corporation
www.faircom.com