RFR: 8274794: Print all owned locks in hs_err file [v3]
Thomas Stuefe
stuefe at openjdk.java.net
Mon Oct 18 15:58:50 UTC 2021
On Mon, 18 Oct 2021 13:24:27 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:
>> See CR for details. This saves the created mutex in a mutex_array during Mutex construction so that all Mutex, not just the ones in mutexLocker.cpp can be printed in the hs_err file. ThreadCritical is used to protect the mutex_array, and to avoid UB should be used when printing the owned locks, but since that is done during error handling, this seemed better not to lock during error handling. There's 0 probability that another thread will be creating a lock during this error handling anyway.
>> Tested with tier1-8.
>
> Coleen Phillimore has updated the pull request incrementally with one additional commit since the last revision:
>
> tstuefe suggestions.
Hi Coleen, this looks good to me now. My remaining remarks are bikeshedding. Thanks for taking my suggestions.
..Thomas
src/hotspot/share/runtime/mutex.cpp line 290:
> 288: ThreadCritical tc;
> 289: Mutex* old_next = _next_mutex;
> 290: assert(old_next != nullptr, "only static mutexes don't have a next");
How about "this list can never be empty"?
-------------
Marked as reviewed by stuefe (Reviewer).
PR: https://git.openjdk.java.net/jdk/pull/5958
More information about the hotspot-dev
mailing list