saro sun
|
Regarding nw_pthread_create error
|
saro sun
05/25/2011 10:26 AM
post86127
|
Regarding nw_pthread_create error
Hello,
I have tried to implement the nw_pthread_create instead of pthread_create
for sdio thread which used to initialize the sdio wifi card.
Source code:
pthread_attr_init(&pattr);
pthread_attr_setschedpolicy(&pattr,SCHED_RR);
param.sched_priority = priority;
pthread_attr_setschedparam(&pattr,¶m);
pthread_attr_setinheritsched(&pattr, PTHREAD_EXPLICIT_SCHED);
pthread_attr_setdetachstate(&pattr, PTHREAD_CREATE_DETACHED);
pthread_attr_setstacksize(&pattr, SD_THREAD_STACK_SIZE);
#if QNX_THREAD
if((status = pthread_create(&pHandle->osThreadId,(const pthread_attr_t
*)&pattr,
(Qnx_Thread_Function)pFunction,pContext)) != SD_SUCCESS)
{
sd_Error("Could not create Thread - Tx err: %u\n",status);
SD_FREE(pStackStart);
return (SD_ERROR_INVALID);
}
#else
if((status = nw_pthread_create(&pHandle->osThreadId,(const
pthread_attr_t *)&pattr,
(Qnx_Thread_Function)pFunction,pContext,0,NULL,NULL)) != SD_SUCCESS)
{
sd_Error("Could not create Thread - Tx err: %u\n",status);
SD_FREE(pStackStart);
return (SD_ERROR_INVALID);
}
#endif
But It returns error No. 22
Please let me know if any example source code or how to implement the
nw_pthread_create() function.
Best Regards,
Saravana
|
|
|