On Wed, 21 Apr 2021 04:39:35 GMT, David Holmes <dhol...@openjdk.org> wrote:
>> Borrowing the HandshakeState lock does create an artificial coupling here. >> I'd prefer to see this API in a more natural place with friendship used to >> access the mechanism as needed. Future cleanup though. > > Also I think you'd have a lost-wakeup problem if two locks were involved. You are correct, above those not work as is. We would need to protect the suspend flag with SomeOtherLock, thus also needing to lock SomeOtherLock when suspending. ------------- PR: https://git.openjdk.java.net/jdk/pull/3191