40 guarantee(get_thread() == thread, "must be the same thread, quickly"); |
40 guarantee(get_thread() == thread, "must be the same thread, quickly"); |
41 guarantee(get_thread_slow() == thread, "must be the same thread, slowly"); |
41 guarantee(get_thread_slow() == thread, "must be the same thread, slowly"); |
42 } |
42 } |
43 |
43 |
44 void ThreadLocalStorage::init() { |
44 void ThreadLocalStorage::init() { |
45 assert(ThreadLocalStorage::thread_index() == -1, "More than one attempt to initialize threadLocalStorage"); |
45 assert(!is_initialized(), |
|
46 "More than one attempt to initialize threadLocalStorage"); |
46 pd_init(); |
47 pd_init(); |
47 set_thread_index(os::allocate_thread_local_storage()); |
48 set_thread_index(os::allocate_thread_local_storage()); |
48 generate_code_for_get_thread(); |
49 generate_code_for_get_thread(); |
49 } |
50 } |
|
51 |
|
52 bool ThreadLocalStorage::is_initialized() { |
|
53 return (thread_index() != -1); |
|
54 } |