Added T:Send bound to Queue<T> to avoid specialized Drop impl.

This commit is contained in:
Felix S. Klock II 2015-03-21 13:22:21 +01:00
parent 26a79e3c20
commit 1249e60891
2 changed files with 2 additions and 2 deletions

View File

@ -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>>,
}

View File

@ -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?