8350616: Skip ValidateHazardPtrsClosure in non-debug builds

Reviewed-by: shade
Backport-of: e43960a017
This commit is contained in:
Satyen Subramaniam
2025-03-12 16:17:48 +00:00
committed by Vitaly Provodin
parent 8c421bd779
commit 825d308a62

View File

@@ -367,6 +367,7 @@ class ScanHazardPtrPrintMatchingThreadsClosure : public ThreadClosure {
}
};
#ifdef ASSERT
// Closure to validate hazard ptrs.
//
class ValidateHazardPtrsClosure : public ThreadClosure {
@@ -387,6 +388,7 @@ class ValidateHazardPtrsClosure : public ThreadClosure {
p2i(thread));
}
};
#endif
// Closure to determine if the specified JavaThread is found by
// threads_do().
@@ -951,8 +953,10 @@ void ThreadsSMRSupport::free_list(ThreadsList* threads) {
log_debug(thread, smr)("tid=" UINTX_FORMAT ": ThreadsSMRSupport::free_list: threads=" INTPTR_FORMAT " is not freed.", os::current_thread_id(), p2i(threads));
}
#ifdef ASSERT
ValidateHazardPtrsClosure validate_cl;
threads_do(&validate_cl);
#endif
delete scan_table;
}