Manual page for pthread_detach(3T)
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
Created by unroff & hp-tools.
© by Hans-Peter Bischof. All Rights Reserved (1997).
Last modified 21/April/97