RFR: 8255119: Monitor::wait takes signed integer as timeout

Gerard Ziemski gziemski at openjdk.org
Mon Jan 9 21:37:52 UTC 2023


On Mon, 9 Jan 2023 07:52:31 GMT, David Holmes <dholmes at openjdk.org> wrote:

> Please review this simple cleanup of the JVM `Monitor`/`PlatformMonitor` code so that timeouts are expressed as unsigned rather than signed values i.e. `int64_t`/`jlong` -> `uint64_t`.
> 
> Testing:
>  - tiers 1-3
>  - all builds in Oracle CI in tiers 1-5, plus shenandoah GC on LInux x64
> 
> Thanks

Marked as reviewed by gziemski (Committer).

LGTM

Looks like there are other APIs where we use signed values for the time, which is illegal - do we have an issue tracking that cleanup?


int PlatformEvent::park(jlong millis) {
  // Transitions for _event:
  //   -1 => -1 : illegal
  //    1 =>  0 : pass - return immediately
  //    0 => -1 : block; then set _event to 0 before returning

-------------

PR: https://git.openjdk.org/jdk/pull/11898


More information about the hotspot-runtime-dev mailing list