1795 // Case 14 is tested by test/hotspot/jtreg/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java. |
1795 // Case 14 is tested by test/hotspot/jtreg/runtime/ErrorHandling/SafeFetchInErrorHandlingTest.java. |
1796 // Case 15 is tested by test/hotspot/jtreg/runtime/ErrorHandling/SecondaryErrorTest.java. |
1796 // Case 15 is tested by test/hotspot/jtreg/runtime/ErrorHandling/SecondaryErrorTest.java. |
1797 // Case 16 is tested by test/hotspot/jtreg/runtime/ErrorHandling/ThreadsListHandleInErrorHandlingTest.java. |
1797 // Case 16 is tested by test/hotspot/jtreg/runtime/ErrorHandling/ThreadsListHandleInErrorHandlingTest.java. |
1798 // Case 17 is tested by test/hotspot/jtreg/runtime/ErrorHandling/NestedThreadsListHandleInErrorHandlingTest.java. |
1798 // Case 17 is tested by test/hotspot/jtreg/runtime/ErrorHandling/NestedThreadsListHandleInErrorHandlingTest.java. |
1799 |
1799 |
1800 // We grab Threads_lock to keep ThreadsSMRSupport::print_info_on() |
1800 // We try to grab Threads_lock to keep ThreadsSMRSupport::print_info_on() |
1801 // from racing with Threads::add() or Threads::remove() as we |
1801 // from racing with Threads::add() or Threads::remove() as we |
1802 // generate the hs_err_pid file. This makes our ErrorHandling tests |
1802 // generate the hs_err_pid file. This makes our ErrorHandling tests |
1803 // more stable. |
1803 // more stable. |
1804 MutexLocker ml(Threads_lock->owned_by_self() ? NULL : Threads_lock, Mutex::_no_safepoint_check_flag); |
1804 if (!Threads_lock->owned_by_self()) { |
|
1805 Threads_lock->try_lock(); |
|
1806 // The VM is going to die so no need to unlock Thread_lock. |
|
1807 } |
1805 |
1808 |
1806 switch (how) { |
1809 switch (how) { |
1807 case 1: vmassert(str == NULL, "expected null"); break; |
1810 case 1: vmassert(str == NULL, "expected null"); break; |
1808 case 2: vmassert(num == 1023 && *str == 'X', |
1811 case 2: vmassert(num == 1023 && *str == 'X', |
1809 "num=" SIZE_FORMAT " str=\"%s\"", num, str); break; |
1812 "num=" SIZE_FORMAT " str=\"%s\"", num, str); break; |