rust/src/rt/sync/lock_free_queue.h

20 lines
404 B
C
Raw Normal View History

2010-06-23 21:03:09 -07:00
#ifndef LOCK_FREE_QUEUE_H
#define LOCK_FREE_QUEUE_H
class lock_free_queue_node {
public:
2010-06-23 21:03:09 -07:00
lock_free_queue_node *next;
lock_free_queue_node();
2010-06-23 21:03:09 -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();
bool is_empty();
2010-06-23 21:03:09 -07:00
};
#endif /* LOCK_FREE_QUEUE_H */