Package org.h2.util

# Class Utils21

java.lang.Object
org.h2.util.Utils21

public final class Utils21 extends 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

Modifier and Type
Method
Description
`static Thread`
`newVirtualThread(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 Details

### newVirtualThread

public static Thread newVirtualThread(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