RFR: 8336384: AbstractQueuedSynchronizer.acquire should cancel acquire when failing due to a LinkageError or other errors [v2]
Alan Bateman
alanb at openjdk.org
Tue Aug 13 08:04:48 UTC 2024
On Mon, 12 Aug 2024 23:39:02 GMT, David Holmes <dholmes at openjdk.org> wrote:
> It has been a while since I knew this code reasonably well so perhaps I have just forgotten this difference between AQS and built-in monitors, but it seems that a Condition.await can return by throwing an exception without re-acquiring the associated synchronizer. Or is that handled at a higher-level?
The semantics are the same as monitor wait/notify so Condition.await must guarantee to hold the lock when it returns. If ConditionNode.block were to throw something like StackOverflowError then there would be an issue (it's a different park to the one changed in this PR but I think you do have a good point).
-------------
PR Comment: https://git.openjdk.org/jdk/pull/20548#issuecomment-2285609879
More information about the core-libs-dev
mailing list