RFR: 8366970: CPUTimeUsage: Add comment about usage during VM exit
Thomas Schatzl
tschatzl at openjdk.org
Fri Sep 5 14:12:11 UTC 2025
On Fri, 5 Sep 2025 10:06:32 GMT, Jonas Norlinder <duke at openjdk.org> wrote:
> Some of the methods in CPUTimeUsage make a query on the underlying threads. Calling those methods during VM exit is therefore unsafe. This PR adds a comment to provide clarification.
Looks good, but maybe it makes sense to add an assert-flag to the `Thread` that indicates whether the `Thread` has been terminated, and fail here.
(My change request is purely about the additional newline, the suggestion above is just something that is possible. Not sure it is worth).
src/hotspot/share/services/cpuTimeUsage.hpp line 33:
> 31: // It may be unsafe to call these methods during VM exit
> 32: // as threads are terminating
> 33:
Suggestion:
Proper sentences need a full stop at the end too.
-------------
Changes requested by tschatzl (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/27115#pullrequestreview-3189526429
PR Review Comment: https://git.openjdk.org/jdk/pull/27115#discussion_r2325203856
More information about the hotspot-gc-dev
mailing list