RFR: 8339540: Unify include requirements for PlatformMonitor/Mutex constructors/destructors

Stefan Karlsson stefank at openjdk.org
Wed Sep 4 13:41:49 UTC 2024


Today, if you write code that, potentially implicitly, calls a the `PlatformMonitor` destructor you need to include `os.inline.hpp` to get it to compile on Windows but you don't need to do that for "posix" platforms.

That's because the destructor is located in `os_posix.cpp` for "posix" and `os_windows.inline.hpp` for Windows.

This leads to the situation that you can get everything to compile on Linux, just for it to fail linking when you later build it on Windows. I propose that we simplify this and move the constructors and destructors to the cpp files.

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

Commit messages:
 - 8339540: Unify include requirements for PlatformMonitor/Mutex constructors/destructors

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

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


More information about the hotspot-runtime-dev mailing list