Skip to content

Commit

Permalink
8350616: Skip ValidateHazardPtrsClosure in non-debug builds
Browse files Browse the repository at this point in the history
Reviewed-by: kbarrett, tschatzl, shade
  • Loading branch information
David Holmes committed Feb 26, 2025
1 parent 9ec4696 commit e43960a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/hotspot/share/runtime/threadSMR.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ class ScanHazardPtrPrintMatchingThreadsClosure : public ThreadClosure {
}
};

#ifdef ASSERT
// Closure to validate hazard ptrs.
//
class ValidateHazardPtrsClosure : public ThreadClosure {
Expand All @@ -386,6 +387,7 @@ class ValidateHazardPtrsClosure : public ThreadClosure {
p2i(thread));
}
};
#endif

// Closure to determine if the specified JavaThread is found by
// threads_do().
Expand Down Expand Up @@ -950,8 +952,10 @@ void ThreadsSMRSupport::free_list(ThreadsList* threads) {
log_debug(thread, smr)("tid=%zu: 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;
}
Expand Down

0 comments on commit e43960a

Please sign in to comment.