Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8270876

Deprecate the FilterSpuriousWakeups flag so it can be removed

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P4 P4
    • 18
    • hotspot
    • None
    • behavioral
    • minimal
    • Hide
      We do not expect anybody to be setting this flag to false. The effect of disabling would not be noticeable to correctly written synchronization code that should always wait in a loop checking a condition (because spurious wakeups are permitted at the API level).
      Show
      We do not expect anybody to be setting this flag to false. The effect of disabling would not be noticeable to correctly written synchronization code that should always wait in a loop checking a condition (because spurious wakeups are permitted at the API level).
    • add/remove/modify command line option
    • Implementation

      Summary

      Deprecate the FilterSpuriousWakeups flag in JDK 18 so it can be obsoleted in JDK 19 and finally removed in JDK 20.

      Problem

      The FilterSpuriousWakeups flag is an archaic flag that can be used to adjust the behaviour of only one of the three core Java blocking API's - Object.wait(timeout) - on Posix systems only. The other API's (Thread.sleep and LockSupport.park(nanos), and on non-Posix systems, will always filter OS-level spurious wakeups. As filtering OS-level spurious wakeups is a desirable characteristic there is never any reason to not filter them - and we have no knowledge of when such spurious wakeups may even be possible at the OS level.

      Solution

      Deprecate the FilterSpuriousWakeups flag in JDK 18, obsolete it in JDK 19, and remove it in JDK 20.

      Specification

      Update the flag description to show it is deprecated:

      >   product(bool, FilterSpuriousWakeups, true,                                \
      >           "(Deprecated) When true prevents OS-level spurious, or premature,"\
      >           " wakeups from Object.wait (Ignored for Windows)")                \

      Add the flag to the deprecated flag table to deprecate in 18, obsolete in 19 and remove in 20:

      + { "FilterSpuriousWakeups", JDK_Version::jdk(18), JDK_Version::jdk(19), JDK_Version::jdk(20) },

            dholmes David Holmes
            dholmes David Holmes
            Kim Barrett
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: