8230423: Move os::sleep to JavaThread::sleep

Reviewed-by: rehn, dcubed
This commit is contained in:
David Holmes 2019-09-11 22:09:05 -04:00
parent 091cf3608b
commit 99252bd9d6
14 changed files with 84 additions and 79 deletions

View file

@ -2990,7 +2990,7 @@ JVM_ENTRY(void, JVM_Sleep(JNIEnv* env, jclass threadClass, jlong millis))
} else {
ThreadState old_state = thread->osthread()->get_state();
thread->osthread()->set_state(SLEEPING);
if (os::sleep(thread, millis) == OS_INTRPT) {
if (!thread->sleep(millis)) { // interrupted
// An asynchronous exception (e.g., ThreadDeathException) could have been thrown on
// us while we were sleeping. We do not overwrite those.
if (!HAS_PENDING_EXCEPTION) {