RFR: 8317514: Ensure MemorySegment is initialized before touching NativeMemorySegmentImpl

Maurizio Cimadamore mcimadamore at openjdk.org
Fri Oct 13 15:50:12 UTC 2023


This PR makes sure that `MemorySegment` is initialized *before* any of its subclasses.
This is done by centralizing all the memory segment factories in a single implementation class (`SegmentFactories`).
Doing so addresses a possible deadlock condition when using multiple threads.

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

Commit messages:
 - Add test
 - Add copyright
 - Initial push

Changes: https://git.openjdk.org/jdk/pull/16187/files
 Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=16187&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8317514
  Stats: 484 lines in 12 files changed: 313 ins; 147 del; 24 mod
  Patch: https://git.openjdk.org/jdk/pull/16187.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/16187/head:pull/16187

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


More information about the nio-dev mailing list