Skip to content

Commit cb228fd

Browse files
committed
---
yaml --- r: 73301 b: refs/heads/dist-snap c: 86ba457 h: refs/heads/master i: 73299: 13ff7bf v: v3
1 parent 6a37b8c commit cb228fd

File tree

5 files changed

+16
-9
lines changed

5 files changed

+16
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
99
refs/heads/incoming: b50030718cf28f2a5a81857a26b57442734fe854
10-
refs/heads/dist-snap: f59fcd5d5f7ba94f7c705eb2c081760dd2213067
10+
refs/heads/dist-snap: 86ba4573498ef251933fcc784d513c7586dfaae1
1111
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1212
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1313
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/src/libcore/rt/local_sched.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,16 @@ use unstable::finally::Finally;
2323

2424
#[cfg(test)] use rt::uv::uvio::UvEventLoop;
2525

26+
/// Initialize the TLS key. Other ops will fail if this isn't executed first.
27+
pub fn init_tls_key() {
28+
unsafe {
29+
rust_initialize_rt_tls_key();
30+
extern {
31+
fn rust_initialize_rt_tls_key();
32+
}
33+
}
34+
}
35+
2636
/// Give the Scheduler to thread-local storage
2737
pub fn put(sched: ~Scheduler) {
2838
unsafe {

branches/dist-snap/src/libcore/rt/sched.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,8 @@ pub impl Scheduler {
6464

6565
fn new(event_loop: ~EventLoopObject) -> Scheduler {
6666

67-
// Lazily initialize the global state, currently the scheduler TLS key
68-
unsafe { rust_initialize_global_state(); }
69-
extern {
70-
fn rust_initialize_global_state();
71-
}
67+
// Lazily initialize the scheduler TLS key
68+
local_sched::init_tls_key();
7269

7370
Scheduler {
7471
event_loop: event_loop,

branches/dist-snap/src/rt/rust_builtin.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -840,9 +840,9 @@ rust_get_rt_tls_key() {
840840
return &rt_key;
841841
}
842842

843-
// Initialize the global state required by the new scheduler
843+
// Initialize the TLS key used by the new scheduler
844844
extern "C" CDECL void
845-
rust_initialize_global_state() {
845+
rust_initialize_rt_tls_key() {
846846

847847
static lock_and_signal init_lock;
848848
static bool initialized = false;

branches/dist-snap/src/rt/rustrt.def.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ rust_uv_ip4_addrp
222222
rust_uv_ip6_addrp
223223
rust_uv_free_ip4_addr
224224
rust_uv_free_ip6_addr
225-
rust_initialize_global_state
225+
rust_initialize_rt_tls_key
226226
rust_dbg_next_port
227227
rust_new_memory_region
228228
rust_delete_memory_region

0 commit comments

Comments
 (0)