pthread_detach(3P) pthread_detach(3P)
pthread_detach - detach a thread
#include <pthread.h>
int pthread_detach(pthread_t thread);
The pthread_detach() function causes the thread identified by thread to
be detached. This means that storage created by the library on behalf of
the thread will be reclaimed when the thread terminates. A detached
thread cannot be the target of pthread_join().
A thread can be created in detached state using
pthread_attr_setdetachstate(). It can also be implicitly detached using
pthread_join().
On success pthread_detach() returns zero; otherwise an error number is
returned:
[ESRCH] The thread parameter does not identify a thread.
[EINVAL] The thread identified by thread is already detached.
pthread_join(3P), pthread_attr_setdetachstate(3P).
PPPPaaaaggggeeee 1111 [ Back ]
|