[Go to CFHT Home Page] Man Pages
Back to Software Index  BORDER=0Manpage Top Level
    thr_suspend(3T) manual page Table of Contents

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);

MT-Level

MT-Safe

Description

thr_suspend() 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.

thr_continue() 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

thr_suspend() and thr_continue() 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.

See Also

thr_create(3T) , thr_join(3T)

Notes

The are no POSIX counterparts to the Solaris threads suspend and continue functionality described on this man page.


Table of Contents