< prev index next >

src/hotspot/share/runtime/vmOperations.cpp

Print this page

318         jt = NULL;
319       }
320       if (jt == NULL || /* thread not alive */
321           jt->is_exiting() ||
322           jt->is_hidden_from_external_view())  {
323         // add a NULL snapshot if skipped
324         _result->add_thread_snapshot();
325         continue;
326       }
327       ThreadConcurrentLocks* tcl = NULL;
328       if (_with_locked_synchronizers) {
329         tcl = concurrent_locks.thread_concurrent_locks(jt);
330       }
331       snapshot_thread(jt, tcl);
332     }
333   }
334 }
335 
336 void VM_ThreadDump::snapshot_thread(JavaThread* java_thread, ThreadConcurrentLocks* tcl) {
337   ThreadSnapshot* snapshot = _result->add_thread_snapshot(java_thread);
338   snapshot->dump_stack_at_safepoint(_max_depth, _with_locked_monitors);
339   snapshot->set_concurrent_locks(tcl);
340 }
341 
342 volatile bool VM_Exit::_vm_exited = false;
343 Thread * volatile VM_Exit::_shutdown_thread = NULL;
344 
345 int VM_Exit::set_vm_exited() {
346 
347   Thread * thr_cur = Thread::current();
348 
349   assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint already");
350 
351   int num_active = 0;
352 
353   _shutdown_thread = thr_cur;
354   _vm_exited = true;                                // global flag
355   for (JavaThreadIteratorWithHandle jtiwh; JavaThread *thr = jtiwh.next(); ) {
356     if (thr!=thr_cur && thr->thread_state() == _thread_in_native) {
357       ++num_active;
358       thr->set_terminated(JavaThread::_vm_exited);  // per-thread flag

318         jt = NULL;
319       }
320       if (jt == NULL || /* thread not alive */
321           jt->is_exiting() ||
322           jt->is_hidden_from_external_view())  {
323         // add a NULL snapshot if skipped
324         _result->add_thread_snapshot();
325         continue;
326       }
327       ThreadConcurrentLocks* tcl = NULL;
328       if (_with_locked_synchronizers) {
329         tcl = concurrent_locks.thread_concurrent_locks(jt);
330       }
331       snapshot_thread(jt, tcl);
332     }
333   }
334 }
335 
336 void VM_ThreadDump::snapshot_thread(JavaThread* java_thread, ThreadConcurrentLocks* tcl) {
337   ThreadSnapshot* snapshot = _result->add_thread_snapshot(java_thread);
338   snapshot->dump_stack_at_safepoint(_max_depth, _with_locked_monitors, false);
339   snapshot->set_concurrent_locks(tcl);
340 }
341 
342 volatile bool VM_Exit::_vm_exited = false;
343 Thread * volatile VM_Exit::_shutdown_thread = NULL;
344 
345 int VM_Exit::set_vm_exited() {
346 
347   Thread * thr_cur = Thread::current();
348 
349   assert(SafepointSynchronize::is_at_safepoint(), "must be at safepoint already");
350 
351   int num_active = 0;
352 
353   _shutdown_thread = thr_cur;
354   _vm_exited = true;                                // global flag
355   for (JavaThreadIteratorWithHandle jtiwh; JavaThread *thr = jtiwh.next(); ) {
356     if (thr!=thr_cur && thr->thread_state() == _thread_in_native) {
357       ++num_active;
358       thr->set_terminated(JavaThread::_vm_exited);  // per-thread flag
< prev index next >