FairCom Corporation


F.70 ctThrdQueueMlen


Returns the length of the message at the beginning of a queue.

Short Name

ctThrdQueueMlen

TYPE

Threading function

DECLARATION

NINT ctThrdQueueMlen(NINT qid, LONG timeout)

DESCRIPTION

Returns the length of the message at the head (beginning) of the queue, waiting up to timeout milliseconds if the queue is empty. Ordinarily, this call would be followed by a call to ctThrdQueueRead with a zero timeout. If ctThrdLIFOWrite is used, ctThrdQueueMlen is of little value because the head of the queue can change before the message length primitive can be or'ed in a subsequent queue read.

RETURN

Value
Symbolic Constant
Explanation
0
NO_ERROR
Successful function.
90
NQUE_ERR
Invalid qid.
156
NTIM_ERR
block in use by another thread. Timeout error.
514
CQUE_ERR
Queue could not be closed.
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.

EXAMPLE

See ctmtap.c for ctThrdQueueMlen examples.

LIMITATIONS

Can only be used with a ctThrd library.

SEE ALSO

ctThrdQueueClose, ctThrdQueueCount, ctThrdLIFOWrite, ctThrdQueueOpen, ctThrdQueueRead, and ctThrdQueueWrite.


FairCom Corporation
www.faircom.com