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

David Holmes dholmes at openjdk.org
Mon Jan 9 21:37:54 UTC 2023


On Mon, 9 Jan 2023 17:09:10 GMT, Coleen Phillimore <coleenp 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
>
> src/hotspot/os/windows/os_windows.cpp line 5363:
> 
>> 5361: int PlatformMonitor::wait(uint64_t millis) {
>> 5362:   int ret = OS_TIMEOUT;
>> 5363:   if (millis > UINT_MAX) {
> 
> Can you add a one line comment saying why this is?  is it a platform limitation? or just would be mostly infinite if bigger than UINT_MAX?

The platform API actually takes a DWORD aka uint32_t. I will add a comment.

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

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


More information about the hotspot-runtime-dev mailing list