about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2013-05-19 14:24:36 -0700
committerBrian Anderson <banderson@mozilla.com>2013-05-20 15:20:50 -0700
commit86ba4573498ef251933fcc784d513c7586dfaae1 (patch)
tree5c46ae7b927da4a5a8a4942c19d190070f0e7abc /src/libcore
parentf59fcd5d5f7ba94f7c705eb2c081760dd2213067 (diff)
rt: Rename rust_initialize_global_state to rust_initialize_rt_tls_key
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/rt/local_sched.rs10
-rw-r--r--src/libcore/rt/sched.rs7
2 files changed, 12 insertions, 5 deletions
diff --git a/src/libcore/rt/local_sched.rs b/src/libcore/rt/local_sched.rs
index 895354d2218..5f7f8509a7b 100644
--- a/src/libcore/rt/local_sched.rs
+++ b/src/libcore/rt/local_sched.rs
@@ -23,6 +23,16 @@ use unstable::finally::Finally;
 
 #[cfg(test)] use rt::uv::uvio::UvEventLoop;
 
+/// Initialize the TLS key. Other ops will fail if this isn't executed first.
+pub fn init_tls_key() {
+    unsafe {
+        rust_initialize_rt_tls_key();
+        extern {
+            fn rust_initialize_rt_tls_key();
+        }
+    }
+}
+
 /// Give the Scheduler to thread-local storage
 pub fn put(sched: ~Scheduler) {
     unsafe {
diff --git a/src/libcore/rt/sched.rs b/src/libcore/rt/sched.rs
index 3abbb1f79e5..0cdc4e9602b 100644
--- a/src/libcore/rt/sched.rs
+++ b/src/libcore/rt/sched.rs
@@ -64,11 +64,8 @@ pub impl Scheduler {
 
     fn new(event_loop: ~EventLoopObject) -> Scheduler {
 
-        // Lazily initialize the global state, currently the scheduler TLS key
-        unsafe { rust_initialize_global_state(); }
-        extern {
-            fn rust_initialize_global_state();
-        }
+        // Lazily initialize the scheduler TLS key
+        local_sched::init_tls_key();
 
         Scheduler {
             event_loop: event_loop,