PRIVATE void ixEthAccCodeletDispatcherPoll (void* arg, void** ptrRetObj) { if (ixOsalMutexLock (&ixEthAccCodeletDispatcherPollRunning, IX_OSAL_WAIT_FOREVER) != IX_SUCCESS) { printf("Dispatcher: Error starting QMgr Dispatcher thread! Failed to lock mutex.\n"); return; } ixEthAccCodeletDispatcherPollStopTrigger = FALSE; while (1) { if (ixEthAccCodeletDispatcherPollStopTrigger) { break; /* Exit the loop */ } ixOsalYield(); (*ixEthAccCodeletDispatcherFunc) (IX_QMGR_QUELOW_GROUP); } ixOsalMutexUnlock (&ixEthAccCodeletDispatcherPollRunning); /* Exit the thread */ }
/* * Function definition: ixDmaAccCodeletDispatcherPoll() * See header file for documentation. */ PRIVATE void ixDmaAccCodeletDispatcherPoll (void* argUnused, void** ptrRetObjUnused) { while (1) { /* Dma NPE A: queues 19 & 20; NPE B: 24 & 26; NPE B: 25 & 27 */ (*ixDmaAccCodeletDispatcherFunc) (IX_QMGR_QUELOW_GROUP); /* Yield Execution of Current Thread with 0 Delay */ ixOsalYield(); } }
PUBLIC IX_STATUS ixOsalSemaphoreWait (IxOsalOsSemaphore *sid, INT32 timeout) { VALID_HANDLE(sid); struct semaphore *sem = *sid; UINT32 start, duration; if (timeout == IX_OSAL_WAIT_FOREVER) return ixOsalSemaphoreWaitInternal(sem, /* wait */ true); IX_STATUS ixStatus = ixOsalSemaphoreWaitInternal(sem, /* wait */ false); if (!timeout || ixStatus == IX_SUCCESS) return ixStatus; start = IX_OSAL_OEM_TIMESTAMP_GET(); duration = US_TO_TICKS(timeout * 1000); do { ixOsalYield(); ixStatus = ixOsalSemaphoreWaitInternal(sem, /* wait */ false); } while (ixStatus != IX_SUCCESS && IX_OSAL_OEM_TIMESTAMP_GET() - start < duration); return ixStatus; }