silc_thread_queue_alloc

SYNOPSIS

    SilcThreadQueue silc_thread_queue_alloc(int num_pipes, SilcBool fifo);

DESCRIPTION

Allocates new thread queue context and returns it. Returns NULL in case of error and sets the silc_errno. The returned context is immediately ready to be used. For a thread to be able to use the queue it must first connect to it by calling silc_thread_queue_connect. The thread that creates the queue automatically connects to the queue.

The 'num_pipes' specifies the number of pipes that exist in the queue. If `num_pipes' is 0, the 0 is ignored and one pipe is created anyway. By default, caller should create one pipe, unless more are needed. The pipes are referenced by index. First pipe has index 0, second index 1, and so on. The index is given as argument when pushing and popping from the queue.

By default data popped from the queue is done in last-in-first-out order; the most recently added data is popped first. If `fifo' is set to TRUE the order is first-in-first-out; the first added data is popped first.