ctThrdMutexTry Try to acquire mutex immediately. Short Name ctThrdMutexTry() Type Threading function Declaration NINT ctThrdMutexTry(pctMUTEX mutex) Description ctThrdMutexTry() attempts to acquire the mutex immediately. Return If unsuccessful, ctThrdMutexTry() returns with a value of NTIM_ERR (156). If successful, ctThrdMutexTry() returns with a value of zero. On error, check sysiocod for the system level error return.
See c-tree Plus Error Codes for a complete listing of valid c-tree Plus error values. Example pctMUTEX tfin_mtx; NINT rc; COUNT retry = 0;
if (retry < 1000) {
ctThrdSleep((LONG) 50); retry ++; } else {
return(-1); } rc = tfin; ctThrdMutexRel(&tfin_mtx); Limitations Can only be used with a ctThrd library. See also ctThrdMutexGet(), ctThrdMutexRel() |
||||||||||||