On Wed, 22 Jan 2025 12:27:10 GMT, Matthias Ernst <d...@openjdk.org> wrote:
>> src/java.base/share/classes/jdk/internal/foreign/abi/BufferStack.java line >> 52: >> >>> 50: scope.close(); >>> 51: offset = parentOffset; >>> 52: lock.unlock(); >> >> I believe you could have mismatched lock/unlock in some cases > > Which scenario? Apologies - that looks correct because: * we always lock on reserve, then * if there's no space, we unlock and return * if there's space we return a new Frame (which then unlock on close) * if we fail to lock, then we return a normal arena (and there's nothing to unlock) ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/23142#discussion_r1926902590