Skip to content

Commit 2caaa38

Browse files
Cleanups.
1 parent d866fa4 commit 2caaa38

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

substratevm/src/com.oracle.svm.core/src/com/oracle/svm/core/thread/PlatformThreads.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -981,25 +981,20 @@ static void unpark(Thread thread) {
981981
}
982982

983983
/**
984-
* Sleeps for the given number of nanoseconds, wake-ups and interruptions.
984+
* Sleeps for the given number of nanoseconds, dealing with early wake-ups and interruptions.
985985
*/
986986
static void sleep(long nanos) throws InterruptedException {
987987
assert !isCurrentThreadVirtual();
988-
sleep0(nanos);
989-
}
990-
991-
/** Sleep for the given number of nanoseconds, dealing with early wakeups and interruptions. */
992-
static void sleep0(long nanos) throws InterruptedException {
993988
if (nanos < 0) {
994989
throw new IllegalArgumentException("Timeout value is negative");
995990
}
996-
sleep1(nanos);
991+
sleep0(nanos);
997992
if (Thread.interrupted()) { // clears the interrupted flag as required of Thread.sleep()
998993
throw new InterruptedException();
999994
}
1000995
}
1001996

1002-
private static void sleep1(long durationNanos) {
997+
private static void sleep0(long durationNanos) {
1003998
VMOperationControl.guaranteeOkayToBlock("[PlatformThreads.sleep(long): Should not sleep when it is not okay to block.]");
1004999
Thread thread = currentThread.get();
10051000
Parker sleepEvent = getCurrentThreadData().ensureSleepParker();

0 commit comments

Comments
 (0)