# currentThread static method

Thread? currentThread()

Returns the Thread instance representing the currently executing Isolate.

This allows code running inside a spawned Isolate to get a reference back to the `Thread` object that spawned it. Returns `null` if the current Isolate was not spawned by a `Thread` instance.

Example:

    final currentThread = Thread.currentThread();
    print('Current Thread Debug Name: ${currentThread?.debugName}');

## Implementation

    static Thread? currentThread() {
      return _activeThreads[Isolate.current];
    }