Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

thread_halt_self(9r) [osf1 man page]

thread_halt_self(9r)													      thread_halt_self(9r)

NAME
thread_halt_self - General: Handles asynchronous traps for self-terminating kernel threads SYNOPSIS
void thread_halt_self( void ); ARGUMENTS
None DESCRIPTION
The thread_halt_self routine performs the work associated with a variety of asynchronous traps (ASTs) for a kernel thread that terminates itself. A kernel thread terminates itself (or one kernel thread terminates 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 immediately 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 performing the appropriate cleanup work. RETURN VALUES
None SEE ALSO
Routines: thread_terminate(9r) thread_halt_self(9r)

Check Out this Related Man Page

kernel_isrthread(9r)													      kernel_isrthread(9r)

NAME
kernel_isrthread - General: Starts a fixed priority kernel thread dedicated to interrupt service SYNOPSIS
thread_t kernel_isrthread( task_t task, void (*start) (void), int pri ); ARGUMENTS
Specifies a pointer to a task structure. This pointer identifies the task in which the kernel_isrthread routine starts the newly created kernel thread dedicated to interrupt service handling. Specifies a pointer to an routine that is the entry point for the newly created kernel thread. Specifies the scheduling priority level for the newly created kernel thread. See the DESCRIPTION section for the priority usage table that describes the possible scheduling priorities. DESCRIPTION
The kernel_isrthread routine creates and starts a kernel thread at the specified entry point. This kernel thread handles only interrupt service requests in the specified task and at the specified priority level. A kernel module should always attach a kernel thread to the ``first task.'' The following priority usage table describes the possible scheduling priorities. The first column shows a range of priorities. The second column shows an associated scheduling priority constant defined in <src/kernel/kern/sched.h> (if applicable). The third column describes the usage of the priority ranges. To specify a scheduling priority of 38, you pass the constant BASEPRI_SYSTEM. To specify a scheduling priority of 33, you can pass the following: BASEPRI_HIGHEST + 1. -------------------------------------------------------------- Priority Constant Usage -------------------------------------------------------------- 0--31 N/A Realtime kernel threads 32--38 BASEPRI_HIGHEST -- Operating system kernel BASEPRI_SYSTEM threads 44--64 BASEPRI_USER -- User kernel threads BASEPRI_LOWEST -------------------------------------------------------------- RETURN VALUES
Upon successful completion, kernel_isrthread returns a pointer to the thread structure associated with the kernel thread started at the specified entry point. Kernel modules can use this pointer as a handle to a specific kernel thread in calls to other kernel threads-related routines. SEE ALSO
Routines: kernel_thread_w_arg(9r) Data Structures: task(9s), thread(9s) kernel_isrthread(9r)
Man Page