NAME | SYNOPSIS | FEATURES | DESCRIPTION | RETURN VALUE | ERRORS | RESTRICTIONS | ATTRIBUTES | SEE ALSO
#include <exec/chExec.h>int threadSuspend(KnCap * actorcap, int threadli);
CORE
NOTE: These calls are obsolete. Although they are maintained for compatibility reasons, they should be avoided wherever possible. See threadActivate(2K), threadStart(2K), and threadSemInit(2K) for documentation on other calls that can be used instead of threadSuspend(2K) and threadResume(2K). The threadSuspend system call puts the thread whose local identifier is threadli , in the actor whose capability is given by actorcap , into the SUSPENDED state.
A suspended thread may resume execution (enter the ACTIVE state) only if the thread is explicitly resumed using threadResume(2K).
The threadSuspend and threadResume system calls are based on a per-thread suspend counter, initialized to 0 at thread creation, incremented by threadSuspend and decremented by threadResume.
The threadResume system call decrements the suspend counter of the thread whose local identifier is threadli , in the actor whose capability is given by actorcap. It only awakens the thread by setting its state to ACTIVE , if the suspend counter has become 0.
If a thread which is in a BLOCKED state is suspended using threadSuspend, the thread will suspend just after it exits its BLOCKED state. If it is resumed using threadResume while still in the BLOCKED state, it will continue its execution normally after it exits its BLOCKED state (if its suspend counter has become 0). The same rule applies for a thread whose actor is in the STOPPED state.
If actorcap is K_MYACTOR, the thread must be a thread of the current actor.
In this case, if threadli is K_MYSELF, the current thread is used.
Upon successful completion a value of 0 is returned. Otherwise, a negative error code is returned.
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 VALUE | ERRORS | RESTRICTIONS | ATTRIBUTES | SEE ALSO