--- old/src/hotspot/os/windows/os_windows.cpp Sat Nov 18 16:54:44 2017 +++ new/src/hotspot/os/windows/os_windows.cpp Sat Nov 18 16:54:43 2017 @@ -3468,9 +3468,7 @@ void os::hint_no_preempt() {} void os::interrupt(Thread* thread) { - assert(!thread->is_Java_thread() || Thread::current() == thread || - Threads_lock->owned_by_self(), - "possibility of dangling Thread pointer"); + debug_only(Thread::check_for_dangling_thread_pointer(thread);) OSThread* osthread = thread->osthread(); osthread->set_interrupted(true); @@ -3491,8 +3489,7 @@ bool os::is_interrupted(Thread* thread, bool clear_interrupted) { - assert(!thread->is_Java_thread() || Thread::current() == thread || Threads_lock->owned_by_self(), - "possibility of dangling Thread pointer"); + debug_only(Thread::check_for_dangling_thread_pointer(thread);) OSThread* osthread = thread->osthread(); // There is no synchronization between the setting of the interrupt