< prev index next >

src/hotspot/share/runtime/safepointMechanism.cpp

Print this page

        

@@ -82,24 +82,17 @@
     os::set_polling_page((address)(polling_page));
   }
 }
 
 void SafepointMechanism::block_if_requested_slow(JavaThread *thread) {
-  if (uses_thread_local_poll()) {
-    // local poll already checked
+  // local poll already checked, if used.
     if (global_poll()) {
       SafepointSynchronize::block(thread);
     }
-    if (thread->has_handshake()) {
+  if (uses_thread_local_poll() && thread->has_handshake()) {
       thread->handshake_process_by_self();
     }
-  } else {
-    // If we don't have per thread poll this could a handshake or a safepoint
-    if (global_poll()) {
-      SafepointSynchronize::block(thread);
-    }
-  }
 }
 
 void SafepointMechanism::initialize_header(JavaThread* thread) {
   disarm_local_poll(thread);
 }
< prev index next >