cthreadcomm · Section 3
cchan_try_send
NAME
cchan_try_send - try to send a message with no block
LIBRARY
C Collections (libccollections, -lccollections)
SYNOPSIS
#include <ccollections/cthreadcomm.h> ccol_retval cchan_try_send(cchan *ch, cmessage *msg);
DESCRIPTION
Puts the message into the queue that the channel picks for the calling thread if there is room, and returns at once when that queue is full.
PARAMETERS
ch Channel to send through
msg Message to send. On success the ownership of the data moves to the
channel.
RETURN VALUE
ccol_success - The message was sent
ccol_invalid_args - ch 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 chosen direction are turned off
ccol_container_full - The chosen queue is full
NOTES
This call never blocks. The direction comes from the ID of the calling thread, as described in cchan_send(3).