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 FairCom DB Error Codes for a complete listing of valid FairCom DB 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, ctThrdQueueWrite