src/hotspot/share/runtime/java.cpp
changeset 54645 05aaccf7d558
parent 54623 1126f0607c70
child 54669 ad45b3802d4e
--- a/src/hotspot/share/runtime/java.cpp	Mon Apr 29 14:34:10 2019 -0400
+++ b/src/hotspot/share/runtime/java.cpp	Mon Apr 29 16:01:52 2019 -0400
@@ -419,14 +419,14 @@
   // A CAS or OSMutex would work just fine but then we need to manipulate
   // thread state for Safepoint. Here we use Monitor wait() and notify_all()
   // for synchronization.
-  { MutexLocker ml(BeforeExit_lock);
+  { MonitorLocker ml(BeforeExit_lock);
     switch (_before_exit_status) {
     case BEFORE_EXIT_NOT_RUN:
       _before_exit_status = BEFORE_EXIT_RUNNING;
       break;
     case BEFORE_EXIT_RUNNING:
       while (_before_exit_status == BEFORE_EXIT_RUNNING) {
-        BeforeExit_lock->wait();
+        ml.wait();
       }
       assert(_before_exit_status == BEFORE_EXIT_DONE, "invalid state");
       return;