cthreadcomm · Section 3
ccircq_try_send
NAME
ccircq_try_send - try to send a message with no block
LIBRARY
C Collections (libccollections, -lccollections)
SYNOPSIS
#include <ccollections/cthreadcomm.h> ccol_retval ccircq_try_send(ccircq *cq, cmessage *msg);
DESCRIPTION
Puts the message into the queue if there is room, and returns ccol_container_full at once when the queue is full. On success the ownership of msg->data moves to the queue.
PARAMETERS
cq Circular queue to send to
msg Message to send. On success the ownership of the data moves to the
queue.
RETURN VALUE
ccol_success - The message was sent
ccol_invalid_args - cq or msg is NULL, msg->data is NULL while
msg->size is not 0, or msg->data is not NULL
while msg->size is 0
ccol_not_permitted - Sends on the queue are turned off
ccol_container_full - The queue is full
NOTES
This call never blocks. On failure the caller keeps the ownership of msg->data.