Thread.sleep cleanup

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 22
    • Affects Version/s: None
    • Component/s: core-libs
    • b03

      Thread.sleep used to be a sleepy place but there has been a bit of churn in the code recently to support virtual threads, add sleep(Duration), a JFR event, changing the underlying implementation to support sub-millis precision, and changeing the 2-arg sleep to make use of it. The changes have settled down now so we can do some cleanups that came up in PR discussions:

      - Add a private sleepNanos method that creates/commits the JFR event around the sleep, this avoids duplicate code in the 3 sleep methods.
      - Rename JVM_Sleep to JVM_SleepNanos to make it clear that it takes the sleep time in nanoseconds, esp. when Thread.sleep's parameter is milliseconds.

            Assignee:
            Alan Bateman
            Reporter:
            Alan Bateman
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: