/* This function get detach state attribute in thread attributes object. 
PTHREAD_CREATE_JOINABLE Default value, it causes all threads created with attr to be in the joinable state. */
int pthread_attr_getdetachstate(pthread_attr_t const *attr, int *state)
/* This function get detach state attribute in thread attributes object. 
PTHREAD_CREATE_JOINABLE Default value, it causes all threads created with attr to be in the joinable state. */
int pthread_attr_getdetachstate(pthread_attr_t const *attr, int *state)
{
    RT_ASSERT(attr != RT_NULL);
    *state = (int)attr->detachstate;
    return 0;
}