r6.1.1:lfds611_queue_new
Jump to navigation
Jump to search
Source Files
/liblfds611/src/lfds611_queue/lfds611_queue_new.c /liblfds611/inc/liblfds611.h
Prototype
int lfds611_queue_new( struct lfds611_queue_state **qs, lfds611_atom_t number_elements );
Parameters
struct lfds611_queue_state **qs
- The address of a pointer onto which the function allocates the state which represents this queue. The pointer is set to NULL if queue creation fails.
lfds611_atom_t number_elements
- The maximum number of elements which can be present in the queue. If not all elements could be allocated (malloc() fails), qeue creation fails.
Return Value
Returns 1 on success and 0 on failure, with *qs being set to NULL on failure.
Notes
This function instantiates a queue. After instantiation any thread (except the instantiating thread) must before using the queue first call lfds611_queue_use.