Package: org.apache.groovy.util.concurrent

## [Java] Class ThreadHelper

- org.apache.groovy.util.concurrent.ThreadHelper

-     public final class ThreadHelper
      extends Object

  Helper for starting threads that prefers virtual threads when running on Java 21+, falling back to platform threads on older runtimes.

  Since:
    6.0.0

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public static Thread` | `startThread(Runnable task)` Starts a new thread to execute the given task.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Method Detail

    - #### public static Thread startThread(Runnable task)

      Starts a new thread to execute the given task. Uses a virtual thread on Java 21+, otherwise a platform thread.

      Parameters:
        `task` - the runnable to execute
      Returns:
        the started thread