Product Documentation

FairCom ISAM for C

Previous Topic

Next Topic

ctThrdBlockWait

Wait for a block to clear.

Short Name

ctThrdBlockWait()

Type

Threading function

Declaration

NINT ctThrdBlockWait(pctBLOCK block, LONG timeout)

Description

ctThrdBlockWait() behaves similarly to ctThrdBlockGet() except that it does not acquire the block. Rather, it simply waits until the block is not acquired by any thread before permitting the thread to continue. Any number of threads can attempt to wait on a block. Whether or not all waiting threads will successfully pass the block before another thread acquires the block is system dependent. To encourage this behavior, each thread successfully passing a block automatically yields to the other threads.

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, ctThrdBlockGet, ctThrdBlockRel

TOCIndex