8185746: Remove Mutex destructor assertion
authorkbarrett
Mon, 07 Aug 2017 18:50:14 -0400
changeset 46767 e2bb2b8ff65a
parent 46766 1f26ac73b909
child 46768 58f648e29a26
child 46770 77cee0d00727
8185746: Remove Mutex destructor assertion Summary: Remove unneeded ~Mutex(), improve assertion msg in ~Monitor. Reviewed-by: dholmes, coleenp, tschatzl
hotspot/src/share/vm/runtime/mutex.cpp
hotspot/src/share/vm/runtime/mutex.hpp
--- a/hotspot/src/share/vm/runtime/mutex.cpp	Mon Aug 07 12:19:17 2017 +0200
+++ b/hotspot/src/share/vm/runtime/mutex.cpp	Mon Aug 07 18:50:14 2017 -0400
@@ -1159,9 +1159,12 @@
   uintptr_t entrylist = UNS(_EntryList);
   uintptr_t waitset = UNS(_WaitSet);
   uintptr_t ondeck = UNS(_OnDeck);
+  // Print _name with precision limit, in case failure is due to memory
+  // corruption that also trashed _name.
   assert((owner|lockword|entrylist|waitset|ondeck) == 0,
-         "_owner(" INTPTR_FORMAT ")|_LockWord(" INTPTR_FORMAT ")|_EntryList(" INTPTR_FORMAT ")|_WaitSet("
-         INTPTR_FORMAT ")|_OnDeck(" INTPTR_FORMAT ") != 0", owner, lockword, entrylist, waitset, ondeck);
+         "%.*s: _owner(" INTPTR_FORMAT ")|_LockWord(" INTPTR_FORMAT ")|_EntryList(" INTPTR_FORMAT ")|_WaitSet("
+         INTPTR_FORMAT ")|_OnDeck(" INTPTR_FORMAT ") != 0",
+         MONITOR_NAME_LEN, _name, owner, lockword, entrylist, waitset, ondeck);
 #endif
 }
 
@@ -1193,10 +1196,6 @@
 #endif
 }
 
-Mutex::~Mutex() {
-  assert((UNS(_owner)|UNS(_LockWord.FullWord)|UNS(_EntryList)|UNS(_WaitSet)|UNS(_OnDeck)) == 0, "");
-}
-
 Mutex::Mutex(int Rank, const char * name, bool allow_vm_block,
              SafepointCheckRequired safepoint_check_required) {
   ClearMonitor((Monitor *) this, name);
--- a/hotspot/src/share/vm/runtime/mutex.hpp	Mon Aug 07 12:19:17 2017 +0200
+++ b/hotspot/src/share/vm/runtime/mutex.hpp	Mon Aug 07 18:50:14 2017 -0400
@@ -303,7 +303,7 @@
  public:
    Mutex(int rank, const char *name, bool allow_vm_block = false,
          SafepointCheckRequired safepoint_check_required = _safepoint_check_always);
-   ~Mutex () ;
+  // default destructor
  private:
    bool notify ()    { ShouldNotReachHere(); return false; }
    bool notify_all() { ShouldNotReachHere(); return false; }