RFR: 8324972: Potential thread safety issue in DirectByteBuffer.Deallocator that could lead to unspecified runtime behaviour

Per Minborg pminborg at openjdk.org
Wed Jan 31 08:45:08 UTC 2024


This PR proposes to make deallocators and unmappers for memory regions idempotent. This is to prevent (likely very rare) duplicate invocations. 

There are no unit tests but it should be noted that the idempotent behavior (now correct) is similar to the  intended behavior before cf74b8c2a32f33019a13ce80b6667da502cc6722 but where idempotency was not guaranteed in a multi-threaded environment.

Passes tier1, 2, and 3 tests.

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

Commit messages:
 - Make deallocators and unmappers idempotent

Changes: https://git.openjdk.org/jdk/pull/17647/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=17647&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8324972
  Stats: 35 lines in 2 files changed: 15 ins; 1 del; 19 mod
  Patch: https://git.openjdk.org/jdk/pull/17647.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/17647/head:pull/17647

PR: https://git.openjdk.org/jdk/pull/17647


More information about the nio-dev mailing list