pthread_detach(3T)
NAME
pthread_detach − dynamically detaching a thread
SYNOPSIS
POSIX
cc [ flag ... ] file ... −lpthread [ library ... ]
#include <pthread.h>
int pthread_detach(pthread_t threadID);
MT-LEVEL
MT-Safe
DESCRIPTION
pthread_detach() can dynamically reset the detachstate attribute of a thread to PTHREAD_CREATE_DETACHED. For example, a thread could detach itself as follows:
pthread_detach(pthread_self());
RETURN VALUES
Upon successful completion, 0 is returned; otherwise, a non-zero value indicates an error.
ERRORS
These functions fail and return the corresponding value, if any of the following conditions are detected:
EINVAL The value specified by threadID is not a joinable thread.
ESRCH The value specified by threadID is not an existing thread ID.
SEE ALSO
pthread_create(3T), pthread_join(3T)
SunOS 5.5 — Last change: 30 Jun 1995