os::allocate_thread_local_storage()
-
//Linux版(jdk7/hotspot/src/os/linux/vm/os_linux.cpp) int os::allocate_thread_local_storage() { pthread_key_t key; int rslt = pthread_key_create(&key, NULL); assert(rslt == 0, "cannot allocate thread local storage"); return (int)key; }