mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-15 18:15:01 +00:00
core::rt: Queues MessageQueue and WorkQueue are cloneable
This commit is contained in:
parent
d2a1378ed8
commit
fa18a861fb
@ -14,6 +14,7 @@ use vec::OwnedVector;
|
||||
use cell::Cell;
|
||||
use option::*;
|
||||
use unstable::sync::{Exclusive, exclusive};
|
||||
use clone::Clone;
|
||||
|
||||
pub struct MessageQueue<T> {
|
||||
// XXX: Another mystery bug fixed by boxing this lock
|
||||
@ -41,4 +42,12 @@ impl<T: Owned> MessageQueue<T> {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Clone for MessageQueue<T> {
|
||||
fn clone(&self) -> MessageQueue<T> {
|
||||
MessageQueue {
|
||||
queue: self.queue.clone()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -14,6 +14,7 @@ use vec::OwnedVector;
|
||||
use unstable::sync::{Exclusive, exclusive};
|
||||
use cell::Cell;
|
||||
use kinds::Owned;
|
||||
use clone::Clone;
|
||||
|
||||
pub struct WorkQueue<T> {
|
||||
// XXX: Another mystery bug fixed by boxing this lock
|
||||
@ -56,3 +57,11 @@ pub impl<T: Owned> WorkQueue<T> {
|
||||
self.queue.with_imm(|q| q.is_empty() )
|
||||
}
|
||||
}
|
||||
|
||||
impl<T> Clone for WorkQueue<T> {
|
||||
fn clone(&self) -> WorkQueue<T> {
|
||||
WorkQueue {
|
||||
queue: self.queue.clone()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user