THREAD_ABORT(3T) BSD THREAD_ABORT(3T)
NAME
thread_abort - return interrupt status
SYNOPSIS
include <apollo/thread.h>
kern_return_t thread_abort(target_thread)
thread_t target_thread;
DESCRIPTION
thread_abort is normally used for a suspended thread. When the suspended
thread is resumed, it causes any wait that the target thread is in to
return some form of "interrupted" status. Note that if thread_abort is
not called, a thread that is suspended and resumed may never know that it
was suspended.
There is an alternate use of thread_abort: if the target thread is in
any kind of interruptible system call, that call will return with
"interrupted" status. This can be useful if the thread needs to wake up
and examine some state flag.
The target_thread argument specifies the id of the thread to be
interrupted.
Data Structures
The data structures are defined as follows:
thread_t
The basic thread id. This is a black box value that is not
significant outside the thread system. It is guaranteed that no two
active threads on a node will have the same thread id.
kern_return_t
An enumeration of the possible values a system call can return. It
indicates the success or failure of the call. It will either be
[KERN_SUCCESS] to indicate that the call succeeded, or some other
value to describe the reason for the failure.
DIAGNOSTICS
Upon successful completion, an abort request is successfully made to the
target thread and thread_abort returns [KERN_SUCCESS]; otherwise, errno
is set to indicate the error.
ERRORS
This function fails if:
[KERN_FAILURE]
The target thread was not in suspend state.
[KERN_INVALID_ARGUMENT]
The target_thread id is not a valid thread.
[KERN_PROTECTION_FAILURE]
The process this thread is in does not have sufficient rights
to abort the target thread.
SEE ALSO
thread_create(3T), thread_terminate(3T), thread_suspend(3T),
thread_resume(3T), thread_self(3T), thread_info(3T), thread_state(3T),
thread_set_priority(3T), thread_handle_signals(3T), thread_inhibit(3T),
thread_cleanup(3T), thread_startup(3T), threadp_init(3T),
threadp_set(3T), threadp_get(3T).
Section (3P) pthread calls (IEEE P1003.4a) calls
Domain System Software Release Notes, Software Release 10.4
NOTES
This call is part of the low level Domain/OS Pthread interface. Most of
these calls come directly from the Mach thread interface. Except as
noted, they work exactly like the equivalent Mach call; they work between
processes (the thread id is unique for a node) if the calling process has
the appropriate rights relative to the target process.
This call is provided solely for compatibility with the Mach operating
system. New applications should use the Pthread interface instead.