HELPLIB.HLB  —  POSIX Threads, PTHREAD routines, pthread_attr_getdetachstate
    Obtains the detachstate attribute of the specified thread
    attributes object.

1  –  C Binding

    #include <pthread.h>

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

2  –  Arguments

 attr

    Thread attributes object whose detachstate attribute is obtained.

 detachstate

    Receives the value of the detachstate attribute.

3  –  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 a detached state.

    On successful completion, this routine returns a zero and the
    detachstate 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.

4  –  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.

5  –  Associated Routines

       pthread_attr_init()
       pthread_attr_setdetachstate()
Close Help