rv = PTHREAD_CREATE(&id, tattr, pthread_start, start_object); (void)PTHREAD_ATTR_DESTROY(&tattr);
rv = _PT_PTHREAD_CREATE(&id, tattr, pthread_start, start_object); (void)_PT_PTHREAD_ATTR_DESTROY(&tattr);
static PRStatus NewThread(    StartFn start, void *arg, PRThreadPriority prio, PRThreadState state){    PRStatus rv;    switch (thread_provider)    {    case thread_nspr:        {            PRThread *thread = PR_CreateThread(                PR_USER_THREAD, start, arg,                PR_PRIORITY_NORMAL, PR_GLOBAL_THREAD,                PR_JOINABLE_THREAD, 0);            rv = (NULL == thread) ? PR_FAILURE : PR_SUCCESS;        }        break;    case thread_pthread:#if defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS)        {            int rv;            pthread_t id;            pthread_attr_t tattr;            StartObject *start_object;            start_object = PR_NEW(StartObject);            PR_ASSERT(NULL != start_object);            start_object->start = start;            start_object->arg = arg;            rv = PTHREAD_ATTR_INIT(&tattr);            PR_ASSERT(0 == rv);            rv = pthread_attr_setdetachstate(&tattr, PTHREAD_CREATE_DETACHED);            PR_ASSERT(0 == rv);#if !defined(LINUX)            rv = pthread_attr_setstacksize(&tattr, 64 * 1024);            PR_ASSERT(0 == rv);#endif            rv = PTHREAD_CREATE(&id, tattr, pthread_start, start_object);            (void)PTHREAD_ATTR_DESTROY(&tattr);            return (0 == rv) ? PR_SUCCESS : PR_FAILURE;        }#else        PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);        rv = PR_FAILURE;#endif /* defined(_PR_PTHREADS) && !defined(_PR_DCETHREADS) */        break;    case thread_sproc:#if defined(IRIX) && !defined(_PR_PTHREADS)        {            PRInt32 pid;            StartObject *start_object;            start_object = PR_NEW(StartObject);            PR_ASSERT(NULL != start_object);            start_object->start = start;            start_object->arg = arg;            pid = sprocsp(                sproc_start, PR_SALL, start_object, NULL, 64 * 1024);            rv = (0 < pid) ? PR_SUCCESS : PR_FAILURE;        }#else        PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);        rv = PR_FAILURE;#endif  /* defined(IRIX) && !defined(_PR_PTHREADS) */        break;    case thread_win32:#if defined(WIN32)        {            void *th;            PRUintn id;                   StartObject *start_object;            start_object = PR_NEW(StartObject);            PR_ASSERT(NULL != start_object);            start_object->start = start;            start_object->arg = arg;            th = (void*)_beginthreadex(                NULL, /* LPSECURITY_ATTRIBUTES - pointer to thread security attributes */                  0U, /* DWORD - initial thread stack size, in bytes */                windows_start, /* LPTHREAD_START_ROUTINE - pointer to thread function */                start_object, /* LPVOID - argument for new thread */                0U, /*DWORD dwCreationFlags - creation flags */                &id /* LPDWORD - pointer to returned thread identifier */ );            rv = (NULL == th) ? PR_FAILURE : PR_SUCCESS;        }#else        PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);        rv = PR_FAILURE;#endif        break;    default:        PR_SetError(PR_NOT_IMPLEMENTED_ERROR, 0);        rv = PR_FAILURE;    }    return rv;}  /* NewThread */