ck_fifo: Add volatile variation of ISEMPTY, isempty.

ck_pring
Samy Al Bahra 14 years ago
parent 1d3c6e472f
commit 76411d5d63

@ -161,6 +161,13 @@ ck_fifo_spsc_recycle(struct ck_fifo_spsc *fifo)
return (p);
}
CK_CC_INLINE static bool
ck_fifo_spsc_isempty(struct ck_fifo_spsc *fifo)
{
struct ck_fifo_spsc_entry *head = ck_pr_load_ptr(&fifo->head);
return (ck_pr_load_ptr(&head->next) == NULL);
}
#define CK_FIFO_SPSC_ISEMPTY(f) ((f)->head->next == NULL)
#define CK_FIFO_SPSC_FIRST(f) ((f)->head->next)
#define CK_FIFO_SPSC_NEXT(m) ((m)->next)

Loading…
Cancel
Save