cthreadcomm · Section 3
cdynmq_create
NAME
cdynmq_create - create a dynamic queue with no size limit
LIBRARY
C Collections (libccollections, -lccollections)
SYNOPSIS
#include <ccollections/cthreadcomm.h> cdynmq_create(err_str);
DESCRIPTION
Creates a queue with no size limit, kept in a linked list. A send never blocks, and the queue can grow without limit. Memory comes from the standard malloc and free. It is the same as calling cdynmq_create_mp() with NULL memory management procedures.
PARAMETERS
err_str Optional pointer that gets an error string on failure
RETURN VALUE
A pointer to the new dynamic queue, or NULL on failure.
NOTES
All operations on this queue are thread-safe. When you are done with the queue, destroy it with cdynmq_destroy(). fork(2) and this queue can be combined in two supported ways: Call fork(2) before you create the queue, or create it and then call fork(2) followed at once by exec(3). A program that keeps running with no exec(3) after the fork while a queue from before the fork is live is not supported. As a defense in depth beyond that rule, the child never inherits a lock that another thread held, in the locked state, at the instant of the fork. The queue owns no thread of its own either, so a queue that a child inherits this way stays fully usable.