diff options
| author | Michael Bebenita <[email protected]> | 2010-07-19 14:05:18 -0700 |
|---|---|---|
| committer | Michael Bebenita <[email protected]> | 2010-07-19 14:05:18 -0700 |
| commit | 00d1465d13980fc3acf650f182ee0723fbda0e06 (patch) | |
| tree | a73cf5f0f20c0bee6722b33d975eb930919fefdf /src/rt/sync/lock_free_queue.h | |
| parent | Add a test for an obvious-seeming (but not actually legal) kind of cast attem... (diff) | |
| download | rust-00d1465d13980fc3acf650f182ee0723fbda0e06.tar.xz rust-00d1465d13980fc3acf650f182ee0723fbda0e06.zip | |
Added a message passing system based on lock free queues for inter-thread communication. Channels now buffer on the sending side, and no longer require blocking when sending. Lots of other refactoring and bug fixes.
Diffstat (limited to 'src/rt/sync/lock_free_queue.h')
| -rw-r--r-- | src/rt/sync/lock_free_queue.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/rt/sync/lock_free_queue.h b/src/rt/sync/lock_free_queue.h index fba4aa9a..1f09ec52 100644 --- a/src/rt/sync/lock_free_queue.h +++ b/src/rt/sync/lock_free_queue.h @@ -2,14 +2,18 @@ #define LOCK_FREE_QUEUE_H class lock_free_queue_node { +public: lock_free_queue_node *next; + lock_free_queue_node(); }; -class lock_free_queue { +class lock_free_queue : lock_free_queue_node { + lock_free_queue_node *_tail; public: lock_free_queue(); void enqueue(lock_free_queue_node *item); lock_free_queue_node *dequeue(); + bool is_empty(); }; #endif /* LOCK_FREE_QUEUE_H */ |