Class BusyWait


  • public final class BusyWait
    extends java.lang.Object
    Utility class to use "Thread.onSpinWait()" when available.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void onSpinWait()
      If available (Java 9+), use intrinsic Thread#onSpinWait which will reduce CPU consumption during the wait, otherwise fallback to regular spinning.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • onSpinWait

        public static void onSpinWait()
        If available (Java 9+), use intrinsic Thread#onSpinWait which will reduce CPU consumption during the wait, otherwise fallback to regular spinning.