C Collections

cthreadcomm · Section 3

ccircq_try_send

ccircq_try_send - try to send a message with no block

C Collections (libccollections, -lccollections)

#include <ccollections/cthreadcomm.h>
 
ccol_retval ccircq_try_send(ccircq *cq, cmessage *msg);

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.

cq   Circular queue to send to
msg  Message to send. On success the ownership of the data moves to the
     queue.

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

This call never blocks. On failure the caller keeps the ownership of
msg->data.

ccircq_send(3), ccircq_timed_send(3)