On Fri, 1 Nov 2024 08:55:09 GMT, Per Minborg <pminb...@openjdk.org> wrote:
>> Quan Anh Mai has updated the pull request incrementally with one additional >> commit since the last revision: >> >> wait for the close operation to complete on acquire failures > > src/java.base/share/classes/jdk/internal/foreign/SharedSession.java line 90: > >> 88: } >> 89: >> 90: STATE.setOpaque(this, CLOSED); > > Why are we using opaque semantics here and not volatile? Because this variable is not used as a synchronization device, so a stronger order is unnecessary. We still need the store to be observed by other threads when they fail an `acquire` or a `close` so opaque is appropriate here. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/21810#discussion_r1825658329