--- old/src/hotspot/os/windows/os_windows.cpp Wed Nov 8 09:05:01 2017 +++ new/src/hotspot/os/windows/os_windows.cpp Wed Nov 8 09:05:00 2017 @@ -3463,9 +3463,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); @@ -3486,8 +3484,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