src/java.base/share/classes/java/lang/Runtime.java
Print this page
@@ -27,10 +27,11 @@
import java.io.*;
import java.util.StringTokenizer;
import sun.reflect.CallerSensitive;
import sun.reflect.Reflection;
+import jdk.internal.HotSpotIntrinsicCandidate;
/**
* Every Java application has a single instance of class
* {@code Runtime} that allows the application to interface with
* the environment in which the application is running. The current
@@ -873,10 +874,20 @@
}
ClassLoader.loadLibrary(fromClass, libname, false);
}
/**
+ * Method signifying that the caller is momentarily unable to
+ * progress until the occurrence of one or more actions of one or
+ * more other activities. When invoked within each iteration, this
+ * method typically improves performance of spin wait loop
+ * constructions.
+ */
+ @HotSpotIntrinsicCandidate
+ public static void onSpinWait() {};
+
+ /**
* Creates a localized version of an input stream. This method takes
* an {@code InputStream} and returns an {@code InputStream}
* equivalent to the argument in all respects except that it is
* localized: as characters in the local character set are read from
* the stream, they are automatically converted from the local