RFR (S): 8230423: Move os::sleep to JavaThread::sleep

David Holmes david.holmes at oracle.com
Mon Sep 9 05:21:50 UTC 2019


bug: https://bugs.openjdk.java.net/browse/JDK-8230423
webrev: http://cr.openjdk.java.net/~dholmes/8230423/webrev/

This is the next step in the sleep/interrupt support code reshuffle. Now 
that os::sleep is platform independent and only applicable to 
JavaThreads, we can move it to JavaThread as an instance method.

Summary of changes:
- os::sleep moved to JavaThread::sleep as instance method
- signature changed to return bool - true means timed-out; false means 
interrupted
- rearranged the sleep code slightly to remove the initial back-to-back 
nanoTime() calls - as suggested by Roger.
- _SleepEvent moved from Thread to JavaThread
- minor changes to os::interrupt to account for move to JavaThread (this 
code will also be moved to JavaThread in the next fix)
- call sites changed from os::sleep(t,ms) to t->sleep(ms)

Testing:
  - tiers 1-3

Thanks,
David


More information about the hotspot-dev mailing list