static void DispatchWrapper(CommOSWork *work) { unsigned int misses; for (misses = 0; running && (misses < dispatchMaxCycles); ) { if (!dispatch()) { misses++; if ((misses % 32) == 0) { CommOS_Yield(); } } else { misses = 0; } } if (running && (work >= &dispatchWorks[0]) && (work <= &dispatchWorks[NR_CPUS - 1])) { QueueDelayedWork(dispatchWQ, work, dispatchInterval); } }
static void DispatchWrapper(CommOSWork *work) { unsigned int misses; for (misses = 0; running && (misses < dispatchMaxCycles); ) { /* We run for at most dispatchMaxCycles worth of channel no-ops. */ if (!dispatch()) { /* No useful work was done, on any of the channels. */ misses++; if ((misses % 32) == 0) { CommOS_Yield(); } } else { misses = 0; } } if (running && (work >= &dispatchWorks[0]) && (work <= &dispatchWorks[NR_CPUS - 1])) { /* * If still running _and_ this was a regular, time-based run, then * re-arm the timer. */ QueueDelayedWork(dispatchWQ, work, dispatchInterval); } }