rt: Rename rust_initialize_global_state to rust_initialize_rt_tls_key

This commit is contained in:
Brian Anderson 2013-05-19 14:24:36 -07:00
parent f59fcd5d5f
commit 86ba457349
4 changed files with 15 additions and 8 deletions

View File

@ -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 {

View File

@ -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,

View File

@ -840,9 +840,9 @@ rust_get_rt_tls_key() {
return &rt_key;
}
// Initialize the global state required by the new scheduler
// Initialize the TLS key used by the new scheduler
extern "C" CDECL void
rust_initialize_global_state() {
rust_initialize_rt_tls_key() {
static lock_and_signal init_lock;
static bool initialized = false;

View File

@ -222,7 +222,7 @@ rust_uv_ip4_addrp
rust_uv_ip6_addrp
rust_uv_free_ip4_addr
rust_uv_free_ip6_addr
rust_initialize_global_state
rust_initialize_rt_tls_key
rust_dbg_next_port
rust_new_memory_region
rust_delete_memory_region