SYNOPSIS
#include <pthread.h>
int pthread_attr_setdetachstate(pthread_attr_t *attr, int detachstate);
DESCRIPTION
The
- PTHREAD_CREATE_DETACHED
-
Creates a new detached thread. A detached thread disappears without leaving a trace. The thread ID and any of its resources are freed and ready for reuse.
pthread_join() cannot wait for a detached thread. - PTHREAD_CREATE_JOINABLE
-
Creates a new non-detached thread. The thread ID and some of the threads other resources are not freed until
pthread_join() is called.pthread_join() must be called to release any resources associated with the terminated thread.
PARAMETERS
- attr
-
Is a thread attribute object.
- detachstate
-
Is the thread detached state attribute value; one of the values specified in the DESCRIPTION section.
RETURN VALUES
On success,
- EINVAL
-
attr is not an initialized thread attribute object, or detachstate is not a valid detached state setting.
- EFAULT
-
attr is not a valid pointer.
CONFORMANCE
POSIX P1003.1 (1996)
MULTITHREAD SAFETY LEVEL
MT-safe.
PORTING ISSUES
None.
AVAILABILITY
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
PTC MKS Toolkit 10.4 Documentation Build 39.