cc –mt [ flag... ] file...[ library... ] #include <thread.h>int thr_suspend(thread_t target_thread);
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().
If successful, the thr_suspend() and thr_continue() functions return 0. Otherwise, a non-zero value is returned to indicate the error.
The thr_suspend() or thr_continue() functions will fail if:
The target_thread cannot be found in the current process.
The target_thread was not suspended because a subsequent thr_continue() occurred before the suspend completed.
See attributes(5) for descriptions of the following attributes:
|ATTRIBUTE TYPE||ATTRIBUTE VALUE|