src/hotspot/share/runtime/handshake.cpp
changeset 50192 8bc79d2d1568
parent 49449 ef5d5d343e2a
child 50626 9fdfe5ca0e5e
--- a/src/hotspot/share/runtime/handshake.cpp	Sun May 20 22:08:25 2018 +0200
+++ b/src/hotspot/share/runtime/handshake.cpp	Sun May 20 22:10:45 2018 +0200
@@ -29,7 +29,7 @@
 #include "runtime/handshake.hpp"
 #include "runtime/interfaceSupport.inline.hpp"
 #include "runtime/osThread.hpp"
-#include "runtime/semaphore.hpp"
+#include "runtime/semaphore.inline.hpp"
 #include "runtime/task.hpp"
 #include "runtime/timerTrace.hpp"
 #include "runtime/thread.hpp"
@@ -299,8 +299,7 @@
   CautiouslyPreserveExceptionMark pem(thread);
   ThreadInVMForHandshake tivm(thread);
   if (!_semaphore.trywait()) {
-    ThreadBlockInVM tbivm(thread);
-    _semaphore.wait();
+    _semaphore.wait_with_safepoint_check(thread);
   }
   if (has_operation()) {
     HandshakeOperation* op = _operation;