diff options
| author | Felix S. Klock II <pnkfelix@pnkfx.org> | 2015-03-21 13:22:21 +0100 |
|---|---|---|
| committer | Felix S. Klock II <pnkfelix@pnkfx.org> | 2015-03-24 22:27:23 +0100 |
| commit | 1249e6089180211c18fdc381a464274ec95edb25 (patch) | |
| tree | dc49d43c38c9920d04082ce6f70480d51d4950dd /src/libstd/sync | |
| parent | 26a79e3c204496f55b8c6ff9db741672554f1705 (diff) | |
| download | rust-1249e6089180211c18fdc381a464274ec95edb25.tar.gz rust-1249e6089180211c18fdc381a464274ec95edb25.zip | |
Added `T:Send` bound to `Queue<T>` to avoid specialized Drop impl.
Diffstat (limited to 'src/libstd/sync')
| -rw-r--r-- | src/libstd/sync/mpsc/mpsc_queue.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/shared.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libstd/sync/mpsc/mpsc_queue.rs b/src/libstd/sync/mpsc/mpsc_queue.rs index 14ed253d8e2..1be8b0dd862 100644 --- a/src/libstd/sync/mpsc/mpsc_queue.rs +++ b/src/libstd/sync/mpsc/mpsc_queue.rs @@ -72,7 +72,7 @@ struct Node<T> { /// The multi-producer single-consumer structure. This is not cloneable, but it /// may be safely shared so long as it is guaranteed that there is only one /// popper at a time (many pushers are allowed). -pub struct Queue<T> { +pub struct Queue<T: Send> { head: AtomicPtr<Node<T>>, tail: UnsafeCell<*mut Node<T>>, } diff --git a/src/libstd/sync/mpsc/shared.rs b/src/libstd/sync/mpsc/shared.rs index 8d14824d37f..f3930a8a5d6 100644 --- a/src/libstd/sync/mpsc/shared.rs +++ b/src/libstd/sync/mpsc/shared.rs @@ -40,7 +40,7 @@ const MAX_STEALS: isize = 5; #[cfg(not(test))] const MAX_STEALS: isize = 1 << 20; -pub struct Packet<T> { +pub struct Packet<T: Send> { queue: mpsc::Queue<T>, cnt: AtomicIsize, // How many items are on this channel steals: isize, // How many times has a port received without blocking? |
