C Collections

cthreadcomm · Section 3

cdynmq_enable_sending

cdynmq_enable_sending - turn sends on again on a dynamic queue

C Collections (libccollections, -lccollections)

#include <ccollections/cthreadcomm.h>
 
ccol_retval cdynmq_enable_sending(cdynmq *dq);

Clears the flag that cdynmq_disable_sending() set, so sends are
accepted again instead of returning ccol_not_permitted. A new queue
starts with sends on, so you only need this call after sends were
turned off.
 
It wakes every write-direction waiter on the queue (a cselect()
call, a cselect_timed() call or a ceventloop registration),
and each of them scans again and sees the new state. While sends are
off the queue is ready for the write direction (see
cdynmq_disable_sending(3)); with sends on, it is ready while it
holds fewer than ccol_max_elem_count messages.
 
Turning sends off and on again never drops anything: The messages that
were in the queue before stay as they were.

dq   Dynamic queue that gets sends turned on

ccol_success       - Sends are on again
ccol_invalid_args  - dq is NULL

The function is thread-safe.

cdynmq_disable_sending(3), cdynmq_send(3), cdynmq_msg_count(3), ccircq_enable_sending(3)