class ThreadState

Defined at line 23 of file ../../zircon/kernel/object/include/object/thread_state.h

Only RUNNING, SUSPENDED, or DYING threads may participate in

exception handling.

Public Methods

Lifecycle lifecycle ()

Defined at line 78 of file ../../zircon/kernel/object/include/object/thread_state.h

Exception exception ()

Only RUNNING, SUSPENDED, and DYING threads have meaningful

exception state.

Defined at line 108 of file ../../zircon/kernel/object/include/object/thread_state.h

void set (Lifecycle lifecycle)

Defined at line 135 of file ../../zircon/kernel/object/include/object/thread_state.h

void set (Exception exception)

Defined at line 227 of file ../../zircon/kernel/object/include/object/thread_state.h

Enumerations

enum class Lifecycle
Name Value Comments
INITIAL 0

The ThreadDispatcher has been allocated, but not yet
associated to a Thread or an aspace.

INITIALIZED 1

The ThreadDispatcher is now associated to its underlying
Thread and the containing process's address space, and is
waiting to be run.

RUNNING 2

The thread is running.

SUSPENDED 3

The thread is currently suspended.
Note that suspension is orthogonal to being "in an exception".
A thread may be both suspended and in an exception, and the thread
does not "resume" execution until it is resumed from both the
suspension and the exception.

DYING 4

The thread is going to die. It may still be interacting
with exception handling state.

DEAD 5

The thread is being dissociated from all of its state, and
no more interaction with userspace (including exception
handlers) is possible.

The only legal transition that isn't from top-to-bottom occurs

when a thread is resumed after being suspended.

Defined at line 27 of file ../../zircon/kernel/object/include/object/thread_state.h

enum class Exception
Name Value Comments
IDLE 0

There's no pending exception.

UNPROCESSED 1

The thread is waiting for the pending exception to be
processed.

TRY_NEXT 2

The exception has been processed, and the next exception
handler should be queried.

RESUME 3

The exception has been processed, and the thread should
resume.

IDLE threads become UNPROCESSED. UNPROCESSED threads are told

to either RESUME or TRY_NEXT in a loop until they are killed

(no more exception handlers) or resumed, in which case they

become IDLE again.

Defined at line 61 of file ../../zircon/kernel/object/include/object/thread_state.h