Package org.h2.util

Class Utils21


  • public final class Utils21
    extends java.lang.Object
    Utilities with specialized implementations for Java 21 and later versions. This class contains basic implementations for older versions of Java and it is overridden in multi-release JARs.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.Thread newVirtualThread​(java.lang.Runnable task)
      Creates a new virtual thread (on Java 21+) for the specified task.
      • Methods inherited from class java.lang.Object

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

      • newVirtualThread

        public static java.lang.Thread newVirtualThread​(java.lang.Runnable task)
        Creates a new virtual thread (on Java 21+) for the specified task. Use Thread.start() to schedule the thread to execute. On older versions of Java a platform daemon thread is created instead.
        Parameters:
        task - the object to run
        Returns:
        a new thread