< prev index next >

src/hotspot/share/runtime/os.cpp

Print this page




 345 
 346 static void signal_thread_entry(JavaThread* thread, TRAPS) {
 347   os::set_priority(thread, NearMaxPriority);
 348   while (true) {
 349     int sig;
 350     {
 351       // FIXME : Currently we have not decided what should be the status
 352       //         for this java thread blocked here. Once we decide about
 353       //         that we should fix this.
 354       sig = os::signal_wait();
 355     }
 356     if (sig == os::sigexitnum_pd()) {
 357        // Terminate the signal thread
 358        return;
 359     }
 360 
 361     switch (sig) {
 362       case SIGBREAK: {
 363         // Check if the signal is a trigger to start the Attach Listener - in that
 364         // case don't print stack traces.
 365         if (!DisableAttachMechanism && AttachListener::is_init_trigger()) {




 366           continue;









 367         }
 368         // Print stack traces
 369         // Any SIGBREAK operations added here should make sure to flush
 370         // the output stream (e.g. tty->flush()) after output.  See 4803766.
 371         // Each module also prints an extra carriage return after its output.
 372         VM_PrintThreads op;
 373         VMThread::execute(&op);
 374         VM_PrintJNI jni_op;
 375         VMThread::execute(&jni_op);
 376         VM_FindDeadlocks op1(tty);
 377         VMThread::execute(&op1);
 378         Universe::print_heap_at_SIGBREAK();
 379         if (PrintClassHistogram) {
 380           VM_GC_HeapInspection op1(tty, true /* force full GC before heap inspection */);
 381           VMThread::execute(&op1);
 382         }
 383         if (JvmtiExport::should_post_data_dump()) {
 384           JvmtiExport::post_data_dump();
 385         }
 386         break;




 345 
 346 static void signal_thread_entry(JavaThread* thread, TRAPS) {
 347   os::set_priority(thread, NearMaxPriority);
 348   while (true) {
 349     int sig;
 350     {
 351       // FIXME : Currently we have not decided what should be the status
 352       //         for this java thread blocked here. Once we decide about
 353       //         that we should fix this.
 354       sig = os::signal_wait();
 355     }
 356     if (sig == os::sigexitnum_pd()) {
 357        // Terminate the signal thread
 358        return;
 359     }
 360 
 361     switch (sig) {
 362       case SIGBREAK: {
 363         // Check if the signal is a trigger to start the Attach Listener - in that
 364         // case don't print stack traces.
 365         if (!DisableAttachMechanism) {
 366           // Attempt to transit state to AL_INITIALIZING.
 367           AttachListenerState cur_state = AttachListener::transit_state(AL_INITIALIZING, AL_NOT_INITIALIZED);
 368           if (cur_state == AL_INITIALIZING) {
 369             // Attach Listener has been started to initialize. Ignore this signal.
 370             continue;
 371           } else if (cur_state == AL_NOT_INITIALIZED) {
 372             // Start to initialize.
 373             if (!AttachListener::is_init_trigger()) {
 374               // Attach Listener could not be started.
 375               // So we need to transit the state to AL_NOT_INITIALIZED.
 376               AttachListener::set_state(AL_NOT_INITIALIZED);
 377             }
 378             continue;
 379           }
 380         }
 381         // Print stack traces
 382         // Any SIGBREAK operations added here should make sure to flush
 383         // the output stream (e.g. tty->flush()) after output.  See 4803766.
 384         // Each module also prints an extra carriage return after its output.
 385         VM_PrintThreads op;
 386         VMThread::execute(&op);
 387         VM_PrintJNI jni_op;
 388         VMThread::execute(&jni_op);
 389         VM_FindDeadlocks op1(tty);
 390         VMThread::execute(&op1);
 391         Universe::print_heap_at_SIGBREAK();
 392         if (PrintClassHistogram) {
 393           VM_GC_HeapInspection op1(tty, true /* force full GC before heap inspection */);
 394           VMThread::execute(&op1);
 395         }
 396         if (JvmtiExport::should_post_data_dump()) {
 397           JvmtiExport::post_data_dump();
 398         }
 399         break;


< prev index next >