[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]


pthread_attr_getdetachstate

Obtains the detachstate attribute of the specified thread attributes object.

Syntax

pthread_attr_getdetachstate(
                            attr,
                            detachstate );
 


Argument Data Type Access

attr opaque pthread_attr_t read detachstate integer write


C Binding

#include 

int pthread_attr_getdetachstate ( const pthread_attr_t *attr, int *detachstate);

Arguments

attr
Thread attributes object whose detachstate attribute is obtained.
detachstate
Receives the value of the detachstate attribute.

Description

This routine obtains the detachstate attribute of a thread attributes object. This attribute specifies whether threads created using the specified thread attributes object are created in detachedstate.

On successful completion, this routine returns a zero and the detached state attribute is set in detachstate. A value of PTHREAD_CREATE_JOINABLE indicates the thread is not detached, and a value of PTHREAD_CREATE_DETACHED indicates the thread is detached.

See the pthread_attr_setdetachstate description for information about the detachstate attribute.

Return Values

If an error condition occurs, this routine returns an integer value indicating the type of error. Possible return values are as follows:
Return        Description

0 Successful completion. [EINVAL] The value specified by attr does not refer to an existing thread attributes object.


See Also

   pthread_attr_init
   pthread_attr_setdetachstate



[Return to Bookshelf] [Contents] [Previous Section] [Next Section] [Index] [Help]