File tree Expand file tree Collapse file tree 4 files changed +15
-8
lines changed Expand file tree Collapse file tree 4 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,16 @@ use unstable::finally::Finally;
23
23
24
24
#[ cfg( test) ] use rt:: uv:: uvio:: UvEventLoop ;
25
25
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
+
26
36
/// Give the Scheduler to thread-local storage
27
37
pub fn put ( sched : ~Scheduler ) {
28
38
unsafe {
Original file line number Diff line number Diff line change @@ -64,11 +64,8 @@ pub impl Scheduler {
64
64
65
65
fn new ( event_loop : ~EventLoopObject ) -> Scheduler {
66
66
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 ( ) ;
72
69
73
70
Scheduler {
74
71
event_loop : event_loop,
Original file line number Diff line number Diff line change @@ -840,9 +840,9 @@ rust_get_rt_tls_key() {
840
840
return &rt_key;
841
841
}
842
842
843
- // Initialize the global state required by the new scheduler
843
+ // Initialize the TLS key used by the new scheduler
844
844
extern " C" CDECL void
845
- rust_initialize_global_state () {
845
+ rust_initialize_rt_tls_key () {
846
846
847
847
static lock_and_signal init_lock;
848
848
static bool initialized = false ;
Original file line number Diff line number Diff line change @@ -222,7 +222,7 @@ rust_uv_ip4_addrp
222
222
rust_uv_ip6_addrp
223
223
rust_uv_free_ip4_addr
224
224
rust_uv_free_ip6_addr
225
- rust_initialize_global_state
225
+ rust_initialize_rt_tls_key
226
226
rust_dbg_next_port
227
227
rust_new_memory_region
228
228
rust_delete_memory_region
You can’t perform that action at this time.
0 commit comments