thr_suspend(3T)
NAME
thr_suspend, thr_continue − suspend or continue thread execution
SYNOPSIS
#include <thread.h>
int thr_suspend(thread_t target_thread);
int thr_continue(thread_t target_thread);
DESCRIPTION
The thr_suspend() function immediately suspends the execution of the thread specified by target_thread. On successful return from thr_suspend(), the suspended thread is no longer executing. Once a thread is suspended, subsequent calls to thr_suspend() have no effect.
The thr_continue() function resumes the execution of a suspended thread. Once a suspended thread is continued, subsequent calls to thr_continue() have no effect.
A suspended thread will not be awakened by a signal. The signal stays pending until the execution of the thread is resumed by thr_continue().
RETURN VALUES
The thr_suspend() and thr_continue() functions return 0 when successful. A non-zero value indicates an error.
ERRORS
If any of the following conditions are detected, thr_suspend() or thr_continue() fails and returns the corresponding value:
ESRCH target_thread cannot be found in the current process.
ECANCELED target_thread was not suspended because a subsequent thr_continue() occurred before the suspend completed.
EINVAL When thr_continue() returns EINVAL, target_thread has died and thr_join () must be called on it to reclaim its resources.
If the following condition is detected, thr_suspend() fails and returns the corresponding value:
EDEADLK Suspending target_thread will cause all threads in the process to be suspended.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
| MT-Level | MT-Safe |
SEE ALSO
thr_create(3T), thr_join(3T), attributes(5), standards(5)
NOTES
The are no POSIX counterparts to the Solaris threads suspend and continue functionality described on this man page.
SunOS 5.6 — Last change: 8 May 1997