< prev index next >

src/hotspot/share/runtime/mutex.cpp

Print this page
*** 270,14 ***
  Mutex::~Mutex() {
    assert_owner(nullptr);
    os::free(const_cast<char*>(_name));
  }
  
! Mutex::Mutex(Rank rank, const char * name, bool allow_vm_block) : _owner(nullptr) {
    assert(os::mutex_init_done(), "Too early!");
    assert(name != nullptr, "Mutex requires a name");
    _name = os::strdup(name, mtInternal);
  #ifdef ASSERT
    _allow_vm_block  = allow_vm_block;
    _rank            = rank;
    _skip_rank_check = false;
  
--- 270,15 ---
  Mutex::~Mutex() {
    assert_owner(nullptr);
    os::free(const_cast<char*>(_name));
  }
  
! Mutex::Mutex(Rank rank, const char * name, bool allow_vm_block) : _owner(nullptr), _id(-1) {
    assert(os::mutex_init_done(), "Too early!");
    assert(name != nullptr, "Mutex requires a name");
    _name = os::strdup(name, mtInternal);
+   _id = MutexLocker::name2id(name);
  #ifdef ASSERT
    _allow_vm_block  = allow_vm_block;
    _rank            = rank;
    _skip_rank_check = false;
  
< prev index next >