RFR: 8274794: Print all owned locks in hs_err file [v2]

Coleen Phillimore coleenp at openjdk.java.net
Mon Oct 18 13:00:57 UTC 2021


On Mon, 18 Oct 2021 07:00:54 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> src/hotspot/share/runtime/mutex.cpp line 280:
>> 
>>> 278:     ThreadCritical tc;
>>> 279:     Mutex* old_next = _next_mutex;
>>> 280:     assert(old_next != nullptr, "only static mutexes don't have a next");
>> 
>> This was a brainteaser till I realized that the end of the list is composed of the Mutexes created first, which we don't delete. Maybe add that as a comment?
>
> Isn't it only the very first Mutex we create (statically) that doesn't have a next?

Yes, the array is added to the front, so the first Mutex created is a static one so you'll never delete that.  The _mutex_array will never go to null.  Suggestions for comment welcome.

-------------

PR: https://git.openjdk.java.net/jdk/pull/5958


More information about the hotspot-dev mailing list