| 640 | } |
| 641 | |
| 642 | int VMThread::osThreadId() { |
| 643 | const char* osthread = *(const char**) at(_thread_osthread_offset); |
| 644 | if (osthread != NULL) { |
| 645 | // Java thread may be in the middle of termination, and its osthread structure just released |
| 646 | return SafeAccess::load32((int32_t*)(osthread + _osthread_id_offset), -1); |
| 647 | } |
| 648 | return -1; |
| 649 | } |
| 650 | |
| 651 | JNIEnv* VMThread::jni() { |
| 652 | if (_env_offset < 0) { |