pthread_suspend_np3
Suspend a thread
Usage
#include <pthread_np.h>
int
pthread_suspend_np(pthread_t tid);
Library
POSIX Threads Library (libpthread, -lpthread)
Overview
The pthread_suspend_np() function, called on an active thread, causes it to suspend.
It is not safe for the caller of the pthread_suspend_np() function to use any non-async signal safe functions, except pthread_resume_np(3), until suspended thread is resumed, unless measures are taken to ensure that the thread is suspended at a safe point.
Return values
If successful, pthread_suspend_np() function returns 0. Otherwise, an error number is returned to indicate the error.
Errors
The pthread_suspend_np() function will fail if:
- [EDEADLK]
-
An attempt was made to suspend the current thread.
- [EINVAL]
-
The value specified by the tid argument is invalid.
- [ESRCH]
-
No thread could be found corresponding to the thread ID specified by the tid argument.
Releases
59 releases since FreeBSD 4.8-RELEASE; the text changed 35 times.