src/os/windows/vm/os_windows.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File
*** old/src/os/windows/vm/os_windows.cpp	Sun Mar 20 22:33:18 2011
--- new/src/os/windows/vm/os_windows.cpp	Sun Mar 20 22:33:17 2011

*** 3295,3307 **** --- 3295,3312 ---- 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"); OSThread* osthread = thread->osthread(); ! bool interrupted = osthread->interrupted(); interrupted = osthread->interrupted(); if (clear_interrupted == true) { + // There is no synchronization between the setting of the interrupt + // and it being cleared here. It is critical - see 6535709 - that + // we only clear the interrupt state, and reset the interrupt event, + // if we are going to report that we were indeed interrupted - else + // an interrupt can be "lost", leading to spurious wakeups or lost wakeups + // depending on the timing + if (interrupted && clear_interrupted) { osthread->set_interrupted(false); ResetEvent(osthread->interrupt_event()); } // Otherwise leave the interrupted state alone return interrupted;

src/os/windows/vm/os_windows.cpp
Index Unified diffs Context diffs Sdiffs Wdiffs Patch New Old Previous File Next File