std::rt: Remove extra boxes from MessageQueue and SleeperList
This commit is contained in:
parent
761f5fba69
commit
5bcb639836
@ -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()
|
||||
|
@ -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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user