--- old/src/os/windows/vm/os_windows.cpp 2014-08-20 23:21:15.509247901 +0400 +++ new/src/os/windows/vm/os_windows.cpp 2014-08-20 23:21:15.381185511 +0400 @@ -414,6 +414,8 @@ LONG WINAPI topLevelExceptionFilter(struct _EXCEPTION_POINTERS* exceptionInfo); +extern jint volatile vm_getting_terminated; + // Thread start routine for all new Java threads static unsigned __stdcall java_start(Thread* thread) { // Try to randomize the cache line index of hot stack frames. @@ -435,9 +437,17 @@ } } + // Diagnostic code to investigate JDK-6573254 (Part I) + unsigned res = 90115; // non-java thread + if (thread->is_Java_thread()) { + JavaThread* java_thread = (JavaThread*)thread; + res = java_lang_Thread::is_daemon(java_thread->threadObj()) + ? 70115 // java daemon thread + : 80115; // java non-daemon thread + } // Install a win32 structured exception handler around every thread created - // by VM, so VM can genrate error dump when an exception occurred in non- + // by VM, so VM can generate error dump when an exception occurred in non- // Java thread (e.g. VM thread). __try { thread->run(); @@ -453,6 +463,11 @@ Atomic::dec_ptr((intptr_t*)&os::win32::_os_thread_count); } + // Diagnostic code to investigate JDK-6573254 (Part II) + if (OrderAccess::load_acquire(&vm_getting_terminated)) { + return res; + } + return 0; }