P99
|
◆ P99_FIFO_POP
Pop the front element from an atomic FIFO L. This implements a generic interface to an atomic FIFO (First In - First Out) data structure. To use it you just have do some preparatory declarations and add a P99_DECLARE_STRUCT(myData);
P99_POINTER_TYPE(myData);
P99_FIFO_DECLARE(myData_ptr);
struct myData {
...
myData_ptr p99_lifo;
...
};
extern P99_FIFO(myData_ptr) head;
Now myData_ptr el = P99_NEW(myData, \/\* your initializer arguments \*\/);
P99_FIFO_APPEND(&head, el);
...
for (myData_ptr el = P99_FIFO_POP(&head);
el;
el = P99_FIFO_POP(&head)) {
// do something with el and then
free(el);
}
Definition at line 136 of file p99_fifo.h. |