2010-06-23 21:03:09 -07:00
|
|
|
#ifndef LOCK_FREE_QUEUE_H
|
|
|
|
#define LOCK_FREE_QUEUE_H
|
|
|
|
|
|
|
|
class lock_free_queue_node {
|
2010-07-19 14:05:18 -07:00
|
|
|
public:
|
2010-06-23 21:03:09 -07:00
|
|
|
lock_free_queue_node *next;
|
2010-07-19 14:05:18 -07:00
|
|
|
lock_free_queue_node();
|
2010-06-23 21:03:09 -07:00
|
|
|
};
|
|
|
|
|
2010-07-19 14:05:18 -07:00
|
|
|
class lock_free_queue : lock_free_queue_node {
|
|
|
|
lock_free_queue_node *_tail;
|
2010-06-23 21:03:09 -07:00
|
|
|
public:
|
|
|
|
lock_free_queue();
|
|
|
|
void enqueue(lock_free_queue_node *item);
|
|
|
|
lock_free_queue_node *dequeue();
|
2010-07-19 14:05:18 -07:00
|
|
|
bool is_empty();
|
2010-06-23 21:03:09 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* LOCK_FREE_QUEUE_H */
|