pthread_detach - detach a thread
#include <pthread.h>
int pthread_detach(pthread_t thread);
The pthread_detach() function marks the thread
identified by thread
as detached. When a detached thread
terminates, its resources are automatically released back to the system
without the need for another thread to join with the terminated
thread.
Attempting to detach an already detached thread results in unspecified behavior.
On success, pthread_detach() returns 0; on error, it returns an error number.
The following statement detaches the calling thread:
pthread_detach(pthread_self());
pthread_attr_setdetachstate(3), pthread_cancel(3), pthread_create(3), pthread_exit(3), pthread_join(3), pthreads(7)