cthreadcomm · Section 3
ccircq_try_recv
NAME
ccircq_try_recv - try to receive a message with no block
LIBRARY
C Collections (libccollections, -lccollections)
SYNOPSIS
#include <ccollections/cthreadcomm.h>
ccol_retval ccircq_try_recv(ccircq *cq,
cmessage *target_buf);
DESCRIPTION
Takes a message from the queue if one is there, and returns ccol_container_empty at once when the queue is empty. The data is handed over without a copy.
PARAMETERS
cq Circular queue to receive from target_buf Buffer that gets the message
RETURN VALUE
ccol_success - A message was received. The caller must free
target_buf->data.
ccol_invalid_args - cq or target_buf is NULL
ccol_container_empty - The queue is empty
NOTES
This call never blocks. After a successful call the data belongs to the caller, who must free target_buf->data.