std::rt: Remove extra boxes from MessageQueue and SleeperList

This commit is contained in:
Brian Anderson 2013-08-17 17:58:00 -07:00
parent 761f5fba69
commit 5bcb639836
2 changed files with 6 additions and 7 deletions

View File

@ -20,14 +20,13 @@ use unstable::sync::Exclusive;
use clone::Clone;
pub struct MessageQueue<T> {
// XXX: Another mystery bug fixed by boxing this lock
priv queue: ~Exclusive<~[T]>
priv queue: Exclusive<~[T]>
}
impl<T: Send> MessageQueue<T> {
pub fn new() -> MessageQueue<T> {
MessageQueue {
queue: ~Exclusive::new(~[])
queue: Exclusive::new(~[])
}
}
@ -51,7 +50,7 @@ impl<T: Send> MessageQueue<T> {
}
}
impl<T> Clone for MessageQueue<T> {
impl<T: Send> Clone for MessageQueue<T> {
fn clone(&self) -> MessageQueue<T> {
MessageQueue {
queue: self.queue.clone()

View File

@ -20,13 +20,13 @@ use rt::sched::SchedHandle;
use clone::Clone;
pub struct SleeperList {
priv stack: ~Exclusive<~[SchedHandle]>
priv stack: Exclusive<~[SchedHandle]>
}
impl SleeperList {
pub fn new() -> SleeperList {
SleeperList {
stack: ~Exclusive::new(~[])
stack: Exclusive::new(~[])
}
}
@ -56,4 +56,4 @@ impl Clone for SleeperList {
stack: self.stack.clone()
}
}
}
}