src/hotspot/share/runtime/mutex.cpp
changeset 52555 3b2d22602c16
parent 52450 2790da836dc3
child 52581 d402a406bbc3
--- a/src/hotspot/share/runtime/mutex.cpp	Wed Nov 14 14:23:21 2018 +0000
+++ b/src/hotspot/share/runtime/mutex.cpp	Wed Nov 14 09:50:01 2018 -0500
@@ -875,7 +875,7 @@
   }
 #endif // CHECK_UNHANDLED_OOPS
 
-  debug_only(check_prelock_state(Self, StrictSafepointChecks));
+  DEBUG_ONLY(check_prelock_state(Self, StrictSafepointChecks);)
   assert(_owner != Self, "invariant");
   assert(_OnDeck != Self->_MutexEvent, "invariant");
 
@@ -902,7 +902,7 @@
   // Try a brief spin to avoid passing thru thread state transition ...
   if (TrySpin(Self)) goto Exeunt;
 
-  check_block_state(Self);
+  DEBUG_ONLY(check_block_state(Self);)
   if (Self->is_Java_thread()) {
     // Horrible dictu - we suffer through a state transition
     assert(rank() > Mutex::special, "Potential deadlock with special or lesser rank mutex");
@@ -943,7 +943,7 @@
 
 bool Monitor::try_lock() {
   Thread * const Self = Thread::current();
-  debug_only(check_prelock_state(Self, false));
+  DEBUG_ONLY(check_prelock_state(Self, false);)
   // assert(!thread->is_inside_signal_handler(), "don't lock inside signal handler");
 
   // Special case, where all Java threads are stopped.
@@ -1320,7 +1320,7 @@
     // the thread is releasing this lock
 
     Thread* old_owner = _owner;
-    debug_only(_last_owner = old_owner);
+    DEBUG_ONLY(_last_owner = old_owner;)
 
     assert(old_owner != NULL, "removing the owner thread of an unowned mutex");
     assert(old_owner == Thread::current(), "removing the owner thread of an unowned mutex");
@@ -1360,7 +1360,7 @@
     if (thread->is_VM_thread() && !allow_vm_block()) {
       fatal("VM thread using lock %s (not allowed to block on)", name());
     }
-    debug_only(if (rank() != Mutex::special) \
+    DEBUG_ONLY(if (rank() != Mutex::special) \
                thread->check_for_valid_safepoint_state(false);)
   }
   assert(!os::ThreadCrashProtection::is_crash_protected(thread),