static BT_ERROR softirq_dispatcher(BT_HANDLE hThread, void *pParam) { BT_u32 ulPending; BT_SOFTIRQ *p; while(1) { BT_kMutexPend(g_pvMutex, BT_INFINITE_TIMEOUT); ulPending = g_ulPending; if(ulPending) { g_ulPending = 0; p = g_SoftIRQ; do { if(ulPending & 1) { p->pfnHandler(p->pData); } p++; ulPending >>= 1; } while(ulPending); } } return BT_ERR_NONE; }
static void softirq_dispatcher(void *pParam) { BT_u32 ulPending; BT_SOFTIRQ *p; while(1) { BT_PendMutex(g_hMutex, 0); ulPending = g_ulPending; if(ulPending) { g_ulPending = 0; p = g_SoftIRQ; do { if(ulPending & 1) { p->pfnHandler(p->pData); } p++; ulPending >>= 1; } while(ulPending); } } }