Stop using currentTimeMillis to calculate timeout in TestCSLocker

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • tbd
    • Affects Version/s: 20
    • Component/s: hotspot
    • gc

      currentTimeMillis() is not monotonically increasing. To me it seems sleep(timeout) would be much better (and easier to read).

      This is most probably not related to JDK-8293289, a huge offset in time would be needed like daytime saving.

      Although it is not causing JDK-8293289, it is still wrong.

      change
      ```
              // check timeout to success deadlocking
              while(System.currentTimeMillis() < startTime + timeout) {
                  System.out.println("sleeping...");
                  sleep(1000);
              }
      ```
      to something like: `sleep(timeout)`

            Assignee:
            Unassigned
            Reporter:
            Leo Korinth
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: