1316
1317 jlong java_lang_Thread::stackSize(oop java_thread) {
1318 if (_stackSize_offset > 0) {
1319 return java_thread->long_field(_stackSize_offset);
1320 } else {
1321 return 0;
1322 }
1323 }
1324
1325 // Write the thread status value to threadStatus field in java.lang.Thread java class.
1326 void java_lang_Thread::set_thread_status(oop java_thread,
1327 java_lang_Thread::ThreadStatus status) {
1328 // The threadStatus is only present starting in 1.5
1329 if (_thread_status_offset > 0) {
1330 java_thread->int_field_put(_thread_status_offset, status);
1331 }
1332 }
1333
1334 // Read thread status value from threadStatus field in java.lang.Thread java class.
1335 java_lang_Thread::ThreadStatus java_lang_Thread::get_thread_status(oop java_thread) {
1336 assert(Thread::current()->is_Watcher_thread() || Thread::current()->is_VM_thread() ||
1337 JavaThread::current()->thread_state() == _thread_in_vm,
1338 "Java Thread is not running in vm");
1339 // The threadStatus is only present starting in 1.5
1340 if (_thread_status_offset > 0) {
1341 return (java_lang_Thread::ThreadStatus)java_thread->int_field(_thread_status_offset);
1342 } else {
1343 // All we can easily figure out is if it is alive, but that is
1344 // enough info for a valid unknown status.
1345 // These aren't restricted to valid set ThreadStatus values, so
1346 // use JVMTI values and cast.
1347 JavaThread* thr = java_lang_Thread::thread(java_thread);
1348 if (thr == NULL) {
1349 // the thread hasn't run yet or is in the process of exiting
1350 return NEW;
1351 }
1352 return (java_lang_Thread::ThreadStatus)JVMTI_THREAD_STATE_ALIVE;
1353 }
1354 }
1355
1356
1357 jlong java_lang_Thread::thread_id(oop java_thread) {
|
1316
1317 jlong java_lang_Thread::stackSize(oop java_thread) {
1318 if (_stackSize_offset > 0) {
1319 return java_thread->long_field(_stackSize_offset);
1320 } else {
1321 return 0;
1322 }
1323 }
1324
1325 // Write the thread status value to threadStatus field in java.lang.Thread java class.
1326 void java_lang_Thread::set_thread_status(oop java_thread,
1327 java_lang_Thread::ThreadStatus status) {
1328 // The threadStatus is only present starting in 1.5
1329 if (_thread_status_offset > 0) {
1330 java_thread->int_field_put(_thread_status_offset, status);
1331 }
1332 }
1333
1334 // Read thread status value from threadStatus field in java.lang.Thread java class.
1335 java_lang_Thread::ThreadStatus java_lang_Thread::get_thread_status(oop java_thread) {
1336 assert(Threads_lock->owned_by_self() || Thread::current()->is_Watcher_thread() ||
1337 Thread::current()->is_VM_thread() || JavaThread::current()->thread_state() == _thread_in_vm,
1338 "Java Thread is not running in vm");
1339 // The threadStatus is only present starting in 1.5
1340 if (_thread_status_offset > 0) {
1341 return (java_lang_Thread::ThreadStatus)java_thread->int_field(_thread_status_offset);
1342 } else {
1343 // All we can easily figure out is if it is alive, but that is
1344 // enough info for a valid unknown status.
1345 // These aren't restricted to valid set ThreadStatus values, so
1346 // use JVMTI values and cast.
1347 JavaThread* thr = java_lang_Thread::thread(java_thread);
1348 if (thr == NULL) {
1349 // the thread hasn't run yet or is in the process of exiting
1350 return NEW;
1351 }
1352 return (java_lang_Thread::ThreadStatus)JVMTI_THREAD_STATE_ALIVE;
1353 }
1354 }
1355
1356
1357 jlong java_lang_Thread::thread_id(oop java_thread) {
|