thread_halt_self(9r)thread_halt_self(9r)NAMEthread_halt_self - General: Handles asynchronous traps for self-termi‐
nating kernel threads
SYNOPSIS
void thread_halt_self(
void );
ARGUMENTS
None
DESCRIPTION
The thread_halt_self routine performs the work associated with a vari‐
ety of asynchronous traps (ASTs) for a kernel thread that terminates
itself. A kernel thread terminates itself (or one kernel thread termi‐
nates another kernel thread) by calling the thread_terminate routine.
The thread_halt_self routine examines the AST-related member of the
thread structure pointer associated with the kernel thread that wants
to terminate itself. This thread structure pointer was returned in a
previous call to kernel_isrthread or kernel_thread_w_arg and passed by
you to the thread_terminate routine. This AST-related member is set to
a bit that identifies the specific AST trap associated with this kernel
thread. Based on the AST bit set in this member, thread_halt_self does
the appropriate cleanup work before the kernel thread exits from the
kernel.
NOTES
A kernel thread that terminates itself must call thread_halt_self imme‐
diately after the call to thread_terminate. The reason for this is
that thread_terminate only prepares the self-terminating kernel thread
to stop execution. The thread_halt_self routine completes the work
needed to stop execution of the self-terminating kernel thread by per‐
forming the appropriate cleanup work.
RETURN VALUES
None
SEE ALSO
Routines: thread_terminate(9r)thread_halt_self(9r)