@@ -21,29 +21,30 @@ use rt::rtio::{EventLoop, IoFactoryObject};
21
21
use unstable:: finally:: Finally ;
22
22
use rt:: local_ptr;
23
23
use tls = rt:: thread_local_storage;
24
+ use rt:: local:: Local ;
24
25
25
26
#[ cfg( test) ] use rt:: uv:: uvio:: UvEventLoop ;
26
27
27
28
/// Give the Scheduler to thread-local storage
28
- pub fn put ( sched : ~Scheduler ) { unsafe { local_ptr :: put ( sched) } }
29
+ pub fn put ( sched : ~Scheduler ) { Local :: put_local ( sched) }
29
30
30
31
/// Take ownership of the Scheduler from thread-local storage
31
- pub fn take ( ) -> ~Scheduler { unsafe { local_ptr :: take ( ) } }
32
+ pub fn take ( ) -> ~Scheduler { Local :: take_local ( ) }
32
33
33
34
/// Check whether there is a thread-local Scheduler attached to the running thread
34
- pub fn exists ( ) -> bool { local_ptr :: exists ( ) }
35
+ pub fn exists ( ) -> bool { Local :: exists_local :: < Scheduler > ( ) }
35
36
36
37
/// Borrow the thread-local scheduler from thread-local storage.
37
38
/// While the scheduler is borrowed it is not available in TLS.
38
- pub fn borrow ( f : & fn ( & mut Scheduler ) ) { unsafe { local_ptr :: borrow ( f) } }
39
+ pub fn borrow ( f : & fn ( & mut Scheduler ) ) { Local :: borrow_local ( f) }
39
40
40
41
/// Borrow a mutable reference to the thread-local Scheduler
41
42
///
42
43
/// # Safety Note
43
44
///
44
45
/// Because this leaves the Scheduler in thread-local storage it is possible
45
46
/// For the Scheduler pointer to be aliased
46
- pub unsafe fn unsafe_borrow ( ) -> * mut Scheduler { local_ptr :: unsafe_borrow ( ) }
47
+ pub unsafe fn unsafe_borrow ( ) -> * mut Scheduler { Local :: unsafe_borrow_local ( ) }
47
48
48
49
pub unsafe fn unsafe_borrow_io ( ) -> * mut IoFactoryObject {
49
50
let sched = unsafe_borrow ( ) ;
0 commit comments