RFR(S): 8230422: Convert uninterruptible os::sleep calls to os::naked_short_sleep

Kim Barrett kim.barrett at oracle.com
Wed Sep 4 16:25:03 UTC 2019

> On Sep 4, 2019, at 5:39 AM, David Holmes <david.holmes at oracle.com> wrote:
> bug: https://bugs.openjdk.java.net/browse/JDK-8230422
> webrev: http://cr.openjdk.java.net/~dholmes/8230422/webrev/
> This is mostly a mechanical change from os::sleep to os::naked_short_sleep or os::naked_sleep, but it affects code in runtime, jfr, compiler and GC. The patch file is best to use for review purposes.
> Summary of changes:
> - added os::naked_sleep as a wrapper around os::naked_short_sleep for sleeps longer than 1 second** - not usable by JavaThreads
> - os::sleep now only has the old interruptible path and takes a JavaThread parameter rather than thread
> - changed os::sleep(thread,millis,false) to os::naked_short_sleep(millis) or os::naked_sleep(millis) depending on the timeout value
> - changed os::sleep(thread,millis,true) to os::sleep(thread,millis) with checks/changes where needed to ensure "thread" is a JavaThread
> ** Many of the calls to this use a VM flag to define the timeout. That either defaults to 1 or 0 (not used) but is otherwise unconstrained in value. While sleeps longer than one second don't really make sense I didn't want to preclude them without there being a range check in place for the flag itself.
> Testing: tiers 1- 3
> I'd appreciate it if someone involved with Shenandoah can check the one change in that code.
> Thanks,
> David

Looks good.

More information about the hotspot-dev mailing list