FairCom Corporation


F.51 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 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. The argument block is the address of a synchronization object of type ctBLOCK. The timeout parameter is specified in milliseconds.

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 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.

LIMITATIONS

Can only be used with a ctThrd library.

SEE ALSO

ctThrdBlockCls, ctThrdBlockRel, and ctThrdBlockWait.


FairCom Corporation
www.faircom.com