I meet the issue as subject. When i use thread of VcapVencVdecVdis_ipcBitsRecvFxn,the function OSA_semWait() run dead after unfirmly time.
The longest time is 15miniutes,and the shorted time only several seconds. why this issue happen?
Now i copy the code under:
OSA_semWait(&thrObj->bitsInNotifySem,OSA_TIMEOUT_FOREVER);
int OSA_semWait(OSA_SemHndl *hndl, Uint32 timeout)
{
int status = OSA_EFAIL;
pthread_mutex_lock(&hndl->lock);
while(1)
{
if(hndl->count > 0)
{
hndl->count--;
status = OSA_SOK;
break;
}
else
{
if(timeout==OSA_TIMEOUT_NONE)
break;
pthread_cond_wait(&hndl->cond, &hndl->lock);
}
}
pthread_mutex_unlock(&hndl->lock);
return status;
}