RFR: 8274282: Clarify special wait assert

Coleen Phillimore coleenp at openjdk.java.net
Fri Sep 24 16:59:19 UTC 2021


On Fri, 24 Sep 2021 15:02:59 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

> This change removes the assert and tests for Mutex::wait() only allowed with greater than nosafepoint ranked held locks.
> Tested with tier1-3.

I apologize I did a forced update.  @pchilano helped me work out why this assert exists in the code @dholmes-ora also worked it out but I didn't get it yesterday.  The reason for not waiting while holding a non-safepoint checking lock is that the wait could delay safepoints for a blocked thread, when the thread is a JavaThread.  This is because holding the nosafepoint lock has a NoSafepointVerifier, so we won't set the state to blocked while waiting on the lower ranked lock.
I fixed the code to do this assert for JavaThread and assert for NonJavaThread if the lock held is below tty, since that could block a lot of NJT operations.  Also updated one of the tests to call with NJT.
This should help the heap dumping code if it reverts to non-safepoint checking locking.  And also helps solve this mystery of what this code was for.

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

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


More information about the hotspot-runtime-dev mailing list