< prev index next >

src/hotspot/os/windows/os_windows.cpp

Print this page

        

@@ -3595,28 +3595,27 @@
   return OS_OK;
 }
 
 void os::interrupt(Thread* thread) {
   debug_only(Thread::check_for_dangling_thread_pointer(thread);)
-
+  assert(thread->is_Java_thread(), "invariant");
+  JavaThread* jt = (JavaThread*) thread;
   OSThread* osthread = thread->osthread();
   osthread->set_interrupted(true);
   // More than one thread can get here with the same value of osthread,
   // resulting in multiple notifications.  We do, however, want the store
   // to interrupted() to be visible to other threads before we post
   // the interrupt event.
   OrderAccess::release();
   SetEvent(osthread->interrupt_event());
   // For JSR166:  unpark after setting status
-  if (thread->is_Java_thread()) {
-    ((JavaThread*)thread)->parker()->unpark();
-  }
+  jt->parker()->unpark();
 
   ParkEvent * ev = thread->_ParkEvent;
   if (ev != NULL) ev->unpark();
 
-  ev = thread->_SleepEvent;
+  ev = jt->_SleepEvent;
   if (ev != NULL) ev->unpark();
 }
 
 
 bool os::is_interrupted(Thread* thread, bool clear_interrupted) {
< prev index next >