Monitor::wait takes signed integer as timeout

XMLWordPrintable

    • Type: Enhancement
    • Resolution: Fixed
    • Priority: P4
    • 21
    • Affects Version/s: 16
    • Component/s: hotspot
    • b05

      In `mutex.cpp`, `Monitor::wait(int64_t timeout, ...)` takes a signed integer as timeout, and asserts it must be positive , `assert(timeout >= 0, "negative timeout");`. Changing it to `uint64_t` could forbid invalid values.

      A contrived example to trigger the assertion above using the `fastdebug` build: `java -XX:+UseZGC -Xms1g -XX:SoftMaxHeapSize=2g -Xmx4g -XX:ZUncommitDelay=9223372036854775 --version`.

            Assignee:
            David Holmes
            Reporter:
            Albert Yang
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

              Created:
              Updated:
              Resolved: