NAME | SYNOPSIS | FEATURES | DESCRIPTION | RETURN VALUES | ERRORS | RESTRICTIONS | ATTRIBUTES | SEE ALSO
#include <exec/chExec.h>int threadAborted(void);
CORE
This system call is strictly reserved for internal use only. It MUST NOT be used by any application.
The threadAbort system call aborts the thread whose local identifier is threadli in the actor whose capability is given by actorcap .
If actorcap is K_MYACTOR, the aborted thread will be in the current actor.
Aborting a thread has different effects depending on the thread's state:
If the thread is blocked by an ABORTABLE call, ( threadDelay (2K)), the thread exits its blocked state and the blocking kernel call returns a specific error code (K_EABORT); the abortion has been processed by the thread.
Otherwise (the thread is running or blocked in a NON ABORTABLE call), the thread enters the ABORTED state; the abortion still has to be processed. The abortion processing can take three distinct forms:
When a running thread in the ABORTED state issues an ABORTABLE blocking call ( semP (2K)), it does not enter the blocked state; the blocking call returns the specific error code K_EABORT immediately and the thread quits the ABORTED state (the abort has been processed by the thread).
A running thread can invoke the threadAborted system call at any time, in order to test whether it is in the ABORTED state. If the thread is in the ABORTED state threadAborted resets this state, and returns 1 (the abort has been processed by the thread). Subsequent calls to threadAborted will return 0 (if the thread is not aborted again).
Finally, SUPERVISOR actors may also be informed via a (asynchronous) handler call, when threads enter the ABORTED state, using svAbortHandler (2K). In this case, when the thread in the ABORTED state returns to execute within its home actor execution environment (see svTrapConnect (2K)), the actor's abort handler is invoked (if any), and the thread quits the ABORTED state (the abort has been processed by the actor). Consequently, calls to threadAborted from the thread will return 0 (if the thread is not aborted again).
Upon successful completion, threadAbort returns 0. Otherwise, a negative error code is returned.
The threadAborted call returns 1 if the current thread is in the ABORTED state, 0 if not.
actorcap is an inconsistent actor capability, or threadli is not a valid thread identifier in the specified actor.
actorcap does not specify a reachable actor.
Some of the data provided are outside the current actor's address space.
The target actor and the current actor must be located on the same site.
See attributes(5) for descriptions of the following attributes:
ATTRIBUTE TYPE | ATTRIBUTE VALUE |
---|---|
Interface Stability | Evolving |
NAME | SYNOPSIS | FEATURES | DESCRIPTION | RETURN VALUES | ERRORS | RESTRICTIONS | ATTRIBUTES | SEE ALSO