Package: java.lang

## [Java] Class Thread

- java.lang.Thread

-     public class Thread
      extends Object

  GDK enhancements for Thread.

  displayName:
    Thread
  receiverFqcn:
    java.lang.Thread

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public static List<Thread>` | `allThreads(Thread self)` Get all threads
    `` | `public static String` | `dumpAll(Thread self)` Dump the thread dump of all threads
    `` | `public static Thread` | `start(Thread self, Closure closure)` Start a Thread with the given closure as a Runnable instance.
    `` | `public static Thread` | `start(Thread self, String name, Closure closure)` Start a Thread with a given name and the given closure as a Runnable instance.
    `` | `public static Thread` | `startDaemon(Thread self, Closure closure)` Start a daemon Thread with the given closure as a Runnable instance.
    `` | `public static Thread` | `startDaemon(Thread self, String name, Closure closure)` Start a daemon Thread with a given name and the given closure as a Runnable instance.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `addShutdownHook, any, any, asBoolean, asType, clamp, clamp, collect, collect, collect, dump, each, eachMatch, eachMatch, eachWithIndex, every, every, find, find, findAll, findAll, findIndexOf, findIndexOf, findIndexValues, findIndexValues, findLastIndexOf, findLastIndexOf, findResult, findResult, findResult, findResult, getAt, getMetaClass, getMetaPropertyValues, getProperties, grep, grep, hasProperty, identity, inject, inject, inject, inject, inspect, invokeMethod, is, isCase, isNotCase, iterator, metaClass, print, print, printf, printf, println, println, println, putAt, respondsTo, respondsTo, setMetaClass, sleep, sleep, split, sprintf, sprintf, stream, takeIf, tap, toString, use, use, use, with, with, withCloseable, withCloseable, withMethodClosure, withStream, withStream, withTraits`

- - ### Method Detail

    - #### public static List<Thread> allThreads(Thread self)

      Get all threads

      Parameters:
        `self` - placeholder variable used by Groovy categories; ignored for default static methods
      Returns:
        all threads
      Since:
        4.0.16

    - #### public static String dumpAll(Thread self)

      Dump the thread dump of all threads

      Parameters:
        `self` - placeholder variable used by Groovy categories; ignored for default static methods
      Returns:
        the thread dump of all threads
      Since:
        3.0.0

    - #### public static Thread start(Thread self, Closure closure)

      Start a Thread with the given closure as a Runnable instance.

      Parameters:
        `self` - placeholder variable used by Groovy categories; ignored for default static methods
        `closure` - the Runnable closure
      Returns:
        the started thread
      Since:
        1.0

    - #### public static Thread start(Thread self, String name, Closure closure)

      Start a Thread with a given name and the given closure as a Runnable instance.

      Parameters:
        `self` - placeholder variable used by Groovy categories; ignored for default static methods
        `name` - the name to give the thread
        `closure` - the Runnable closure
      Returns:
        the started thread
      Since:
        1.6

    - #### public static Thread startDaemon(Thread self, Closure closure)

      Start a daemon Thread with the given closure as a Runnable instance.

      Parameters:
        `self` - placeholder variable used by Groovy categories; ignored for default static methods
        `closure` - the Runnable closure
      Returns:
        the started thread
      Since:
        1.0

    - #### public static Thread startDaemon(Thread self, String name, Closure closure)

      Start a daemon Thread with a given name and the given closure as a Runnable instance.

      Parameters:
        `self` - placeholder variable used by Groovy categories; ignored for default static methods
        `name` - the name to give the thread
        `closure` - the Runnable closure
      Returns:
        the started thread
      Since:
        1.6