src/hotspot/os/windows/os_windows.cpp
changeset 48105 8d15b1369c7a
parent 48016 df39ee817323
child 48153 cfa2c43e58c2
equal deleted inserted replaced
48096:513e0b467a92 48105:8d15b1369c7a
  3488 // Hint to the underlying OS that a task switch would not be good.
  3488 // Hint to the underlying OS that a task switch would not be good.
  3489 // Void return because it's a hint and can fail.
  3489 // Void return because it's a hint and can fail.
  3490 void os::hint_no_preempt() {}
  3490 void os::hint_no_preempt() {}
  3491 
  3491 
  3492 void os::interrupt(Thread* thread) {
  3492 void os::interrupt(Thread* thread) {
  3493   assert(!thread->is_Java_thread() || Thread::current() == thread ||
  3493   debug_only(Thread::check_for_dangling_thread_pointer(thread);)
  3494          Threads_lock->owned_by_self(),
       
  3495          "possibility of dangling Thread pointer");
       
  3496 
  3494 
  3497   OSThread* osthread = thread->osthread();
  3495   OSThread* osthread = thread->osthread();
  3498   osthread->set_interrupted(true);
  3496   osthread->set_interrupted(true);
  3499   // More than one thread can get here with the same value of osthread,
  3497   // More than one thread can get here with the same value of osthread,
  3500   // resulting in multiple notifications.  We do, however, want the store
  3498   // resulting in multiple notifications.  We do, however, want the store
  3511   if (ev != NULL) ev->unpark();
  3509   if (ev != NULL) ev->unpark();
  3512 }
  3510 }
  3513 
  3511 
  3514 
  3512 
  3515 bool os::is_interrupted(Thread* thread, bool clear_interrupted) {
  3513 bool os::is_interrupted(Thread* thread, bool clear_interrupted) {
  3516   assert(!thread->is_Java_thread() || Thread::current() == thread || Threads_lock->owned_by_self(),
  3514   debug_only(Thread::check_for_dangling_thread_pointer(thread);)
  3517          "possibility of dangling Thread pointer");
       
  3518 
  3515 
  3519   OSThread* osthread = thread->osthread();
  3516   OSThread* osthread = thread->osthread();
  3520   // There is no synchronization between the setting of the interrupt
  3517   // There is no synchronization between the setting of the interrupt
  3521   // and it being cleared here. It is critical - see 6535709 - that
  3518   // and it being cleared here. It is critical - see 6535709 - that
  3522   // we only clear the interrupt state, and reset the interrupt event,
  3519   // we only clear the interrupt state, and reset the interrupt event,