about summary refs log tree commit diff
path: root/src/libcore/rt/sched.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcore/rt/sched.rs')
-rw-r--r--src/libcore/rt/sched.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/libcore/rt/sched.rs b/src/libcore/rt/sched.rs
index 0004ef29de0..20c24adaa0a 100644
--- a/src/libcore/rt/sched.rs
+++ b/src/libcore/rt/sched.rs
@@ -20,9 +20,7 @@ use super::context::Context;
 use super::task::Task;
 use rt::local_ptr;
 use rt::local::Local;
-
-// A more convenient name for external callers, e.g. `local_sched::take()`
-pub mod local_sched;
+use rt::rtio::IoFactoryObject;
 
 /// The Scheduler is responsible for coordinating execution of Coroutines
 /// on a single thread. When the scheduler is running it is owned by
@@ -403,6 +401,12 @@ pub impl Coroutine {
     }
 }
 
+pub unsafe fn unsafe_borrow_io() -> *mut IoFactoryObject {
+    let sched = Local::unsafe_borrow::<Scheduler>();
+    let io: *mut IoFactoryObject = (*sched).event_loop.io().unwrap();
+    return io;
+}
+
 #[cfg(test)]
 mod test {
     use int;