Index of Section 2 Manual Pages
| Interix / SUA | pthread_detach.2 | Interix / SUA |
pthread_detach(2) pthread_detach(2)
pthread_detach()
NAME
pthread_detach() - detach a thread
SYNOPSIS
#include
int pthread_detach(pthread_t thread);
DESCRIPTION
The pthread_detach(2) function causes the storage for the thread
referenced by the thread argument to be reclaimed when the thread
terminates. Calling the pthread_detach() function does not cause the
thread to terminate if the thread has not done so already.
RETURN VALUES
On success, the function returns 0; otherwise, an error code is returned.
ERRORS
The pthread_detach() function can fail for the following reasons:
[EINVAL]
The thread argument does not identify a joinable thread.
[ESRCH]
The thread argument does not identify an existing thread.
This function does not return [EINTR].
NOTES
For every thread that is created, the application should call
pthread_detach(2) or the pthread_join(2) function to ensure that storage
for the thread is reclaimed.
SEE ALSO
pthread_create(2)
pthread_exit(2)
pthread_join(2)
USAGE NOTES
The pthread_detach function is thread safe.
The pthread_detach function is not async-signal safe.