Spaces:
Sleeping
Sleeping
Ticket Name: TDA2: OSA_timerCreate function question | |
Query Text: | |
Part Number: TDA2 Hi, For function OSA_timerCreate Int32 OSA_timerCreate(OSA_TimerHndl *hndl,OSA_TimerCb cbf,union sigval value) Is it a hardware timer, will callback function run in interrupt context? I found in the callback function of TI user case example, there is wait function inside. If it is hardware timer, it will cause disaster, could you explain about it? Also where can i find the definition of timer_create? I want to make sure it has no problem before we use it at large scale commercially. ex: inside callback func System_sendLinkCmd(pObj->tskId, SYSTEM_CMD_NEW_DATA, NULL) is used, finally it will go to OSA_msgqSend int OSA_msgqSend(OSA_MsgqHndl *hndl, OSA_MsgHndl *msg, Uint32 timeout) { int status = OSA_EFAIL; pthread_mutex_lock(&hndl->lock); while(1) { if( hndl->count < hndl->len ) { hndl->queue[hndl->curWr] = msg; hndl->curWr = (hndl->curWr+1)%hndl->len; hndl->count++; status = OSA_SOK; pthread_cond_signal(&hndl->condRd); break; } else { if(timeout == OSA_TIMEOUT_NONE) break; status = pthread_cond_wait(&hndl->condWr, &hndl->lock); } } pthread_mutex_unlock(&hndl->lock); return status; } Best regards HUI | |
Responses: | |
Hi Hui, Timer_Create is standard Linux API to create based on the given clock id. It uses high resolution hrtimer. Now since the timer the callback is in application space, it isnot really running in interrupt context. Where do you see wait in the timer callback? Rgds, Brijesh | |