ctThrdQueueRead Read a queue message. Short Name ctThrdQueueRead() Type Threading function Declaration NINT ctThrdQueueRead(NINT qid, pVOID buffer, NINT buflen, LONG timeout) Description Read a queue message into buffer with maximum length buflen. If buffer is NULL and/or buflen is smaller than the actual message, the message is still removed from the queue, and as much as possible is placed into the buffer. Return In the case of a NULL or an insufficient buffer, ctThrdQueueRead() returns TQUE_ERR (638). If no message is available to be read within the interval specified in milliseconds by the timeout parameter, ctThrdQueueRead() returns NTIM_ERR (156). If more than one thread is reading the queue with an intermediate timeout parameter, i.e., greater than ctNOWAIT and less than ctWAITFOREVER, the length of time before a NTIM_ERR is returned is not accurate and such usage should not be attempted.
See c-tree Plus Error Codes for a complete listing of valid c-tree Plus error values. Example See ctmtap.c for ctThrdQueueRead() examples. Limitations Can only be used with a ctThrd library. See also ctThrdQueueClose(), ctThrdQueueCount(), ctThrdLIFOWrite(), ctThrdQueueMlen(), ctThrdQueueOpen(), ctThrdQueueWrite() |
||||||||||||||||||||||||