JDK-8338949 : Deprecate the `UseLinuxPosixThreadCPUClocks` flag and remove it in a future release
  • Type: CSR
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P4
  • Status: Closed
  • Resolution: Approved
  • Fix Versions: 24
  • Submitted: 2024-08-26
  • Updated: 2024-08-26
  • Resolved: 2024-08-26
Related Reports
CSR :  
Description
Summary
-------

Deprecate the `UseLinuxPosixThreadCPUClocks` flag and remove it in a future release

Problem
-------

The `UseLinuxPosixThreadCPUClocks` flag was added in Java 6 to allow users to select a new, fast, Thread CPU time API on Linux, if it was available. In 6u23 and 7 it was enabled by default. There is no reason for anyone to opt out of using this API today (nor for quite a long time).

Solution
--------

Deprecate the `UseLinuxPosixThreadCPUClocks` flag in JDK 24, make it obsolete in JDK 25 and expire it in JDK 26.

Specification
-------------

Update the flag description to show it is deprecated:
```
    product(bool, UseLinuxPosixThreadCPUClocks, true,                     \
-          "enable fast Linux Posix clocks where available")             \
+          "(Deprecated) enable fast Linux Posix clocks where available") \
```
Add the flag to the deprecated flag table to deprecate in 24, obsolete in 25 and remove in 26:
```
+#ifdef LINUX
+  { "UseLinuxPosixThreadCPUClocks", JDK_Version::jdk(24), JDK_Version::jdk(25), JDK_Version::jdk(26) },
+#endif
```
Comments
Moving to Approved.
26-08-2024

Thanks for the reviews [~kbarrett] and [~stuefe]!
26-08-2024