RFR: 8289230: Move PlatformXXX class declarations out of os_xxx.hpp [v4]

Ioi Lam iklam at openjdk.org
Sat Jul 2 04:26:48 UTC 2022


> There are only two implementations of these classes (one for windows, and one for posix):
> 
> - PlatformEvent
> - PlatformParker
> - PlatformMutex
> - PlatformMonitor
> - ThreadCrashProtection
> 
> Before this PR, these classes are declared in os_xxx.hpp. This causes excessive inclusion of the large header file os.hpp by popular headers such as mutex.hpp, which needs only the declaration of PlatformMutex but not the other stuff in os.hpp
> 
> This PR moves the declarations to park_posix.hpp, mutex_posix.hpp, etc.
> 
> Note:  ideally, the definition of PlatformParker/PlatformEvent should be moved to park_posix.cpp, and PlatformMutex/PlatformMonitor should be moved to mutex_posix.cpp. However, the definition of these 4 classes are intertwined, so I'll leave them inside os_posix.cpp for now. (Same for the Windows version).

Ioi Lam has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains eight additional commits since the last revision:

 - removed unrelated newline change
 - Merge branch 'master' into 8289230-move-Platform-classes-out-of-os-xxx-hpp
 - @coleenp comments
 - fixed comments
 - fixed windows
 - Moved PlatformMutex/PlatformMonitor
 - move-PlatformParker-out-of-os-xxx-hpp
 - Moved ThreadCrashProtection

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/9303/files
  - new: https://git.openjdk.org/jdk/pull/9303/files/9d502ffb..bafda85c

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=9303&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=9303&range=02-03

  Stats: 8540 lines in 227 files changed: 5586 ins; 1406 del; 1548 mod
  Patch: https://git.openjdk.org/jdk/pull/9303.diff
  Fetch: git fetch https://git.openjdk.org/jdk pull/9303/head:pull/9303

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


More information about the serviceability-dev mailing list