src/hotspot/share/runtime/sweeper.cpp
changeset 54645 05aaccf7d558
parent 54623 1126f0607c70
child 57891 460f412c1358
child 58678 9cf78a70fa4f
--- a/src/hotspot/share/runtime/sweeper.cpp	Mon Apr 29 14:34:10 2019 -0400
+++ b/src/hotspot/share/runtime/sweeper.cpp	Mon Apr 29 16:01:52 2019 -0400
@@ -341,9 +341,9 @@
   while (true) {
     {
       ThreadBlockInVM tbivm(JavaThread::current());
-      MutexLocker waiter(CodeCache_lock, Mutex::_no_safepoint_check_flag);
+      MonitorLocker waiter(CodeCache_lock, Mutex::_no_safepoint_check_flag);
       const long wait_time = 60*60*24 * 1000;
-      timeout = CodeCache_lock->wait_without_safepoint_check(wait_time);
+      timeout = waiter.wait(wait_time);
     }
     if (!timeout) {
       possibly_sweep();
@@ -369,7 +369,7 @@
   */
 void NMethodSweeper::force_sweep() {
   ThreadBlockInVM tbivm(JavaThread::current());
-  MutexLocker waiter(CodeCache_lock, Mutex::_no_safepoint_check_flag);
+  MonitorLocker waiter(CodeCache_lock, Mutex::_no_safepoint_check_flag);
   // Request forced sweep
   _force_sweep = true;
   while (_force_sweep) {
@@ -377,7 +377,7 @@
     // In case a sweep currently takes place we timeout and try again because
     // we want to enforce a full sweep.
     CodeCache_lock->notify();
-    CodeCache_lock->wait_without_safepoint_check(1000);
+    waiter.wait(1000);
   }
 }