diff --git a/src/libcore/rt/message_queue.rs b/src/libcore/rt/message_queue.rs index 014e71d3de6..eaab9288ac8 100644 --- a/src/libcore/rt/message_queue.rs +++ b/src/libcore/rt/message_queue.rs @@ -14,6 +14,7 @@ use vec::OwnedVector; use cell::Cell; use option::*; use unstable::sync::{Exclusive, exclusive}; +use clone::Clone; pub struct MessageQueue { // XXX: Another mystery bug fixed by boxing this lock @@ -41,4 +42,12 @@ impl MessageQueue { } } } -} \ No newline at end of file +} + +impl Clone for MessageQueue { + fn clone(&self) -> MessageQueue { + MessageQueue { + queue: self.queue.clone() + } + } +} diff --git a/src/libcore/rt/work_queue.rs b/src/libcore/rt/work_queue.rs index 31f73cd09b5..e9eb663392b 100644 --- a/src/libcore/rt/work_queue.rs +++ b/src/libcore/rt/work_queue.rs @@ -14,6 +14,7 @@ use vec::OwnedVector; use unstable::sync::{Exclusive, exclusive}; use cell::Cell; use kinds::Owned; +use clone::Clone; pub struct WorkQueue { // XXX: Another mystery bug fixed by boxing this lock @@ -56,3 +57,11 @@ pub impl WorkQueue { self.queue.with_imm(|q| q.is_empty() ) } } + +impl Clone for WorkQueue { + fn clone(&self) -> WorkQueue { + WorkQueue { + queue: self.queue.clone() + } + } +}