8205648: fix for 8205195 breaks secondary error handling

Only grab Threads_lock in VMError::controlled_crash() when we don't already own it.

Reviewed-by: sspitsyn, stuefe
This commit is contained in:
Daniel D. Daugherty 2018-06-26 14:15:49 -04:00
parent b03536888a
commit 1af4c68d12

View File

@ -1703,7 +1703,7 @@ void VMError::controlled_crash(int how) {
// from racing with Threads::add() or Threads::remove() as we
// generate the hs_err_pid file. This makes our ErrorHandling tests
// more stable.
MutexLockerEx ml(Threads_lock, Mutex::_no_safepoint_check_flag);
MutexLockerEx ml(Threads_lock->owned_by_self() ? NULL : Threads_lock, Mutex::_no_safepoint_check_flag);
switch (how) {
case 1: vmassert(str == NULL, "expected null"); break;