Class Thread

Class Documentation

class Thread

Thread worker class operating in a ThreadPool.

Public Types

enum ThreadState

Values:

enumerator kUninitialized
enumerator kAliveIdle
enumerator kAliveBusy
enumerator kDead

Public Functions

Thread(ThreadPool *parentPool, VoidFunction initializer = nullptr)

Main constructor.

~Thread()
void RequestShutdown()

Inform thread to shutdown after it finishes current job, if any is in progress.

void WaitForShutdown()

Waits for the thread to end its execution if RequestShutdown was called, NOOP otherwise.

ThreadState State()

Get current state of the worker thread.