ctThrdBlockGet
Get a thread block.
Short Name
ctThrdBlockGet
Type
Threading function
Declaration
NINT ctThrdBlockGet(pctBLOCK block, LONG timeout)
Description
A block differs from a mutex in two significant respects: it may be released by a thread other than the thread which acquired it, and you may specify a timeout value which causes a ctThrdBlockGet() to return with a NTIM_ERR (156) if the block could not be acquired within the specified timeout interval. Like a mutex, a block can be acquired by only one thread at a time.
Return
Value |
Symbolic Constant |
Explanation |
---|---|---|
0 |
NO_ERROR |
Successfully acquired block. |
156 |
NTIM_ERR |
block in use by another thread. Timeout error. |
636 |
TSYF_ERR |
block get failed. |
See FairCom DB Error Codes for a complete listing of valid FairCom DB error values.
Limitations
Can only be used with a ctThrd library.
See also
ctThrdBlockCls, ctThrdBlockRel, ctThrdBlockWait