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);
   }
}
int
CommOS_ScheduleAIOWork(CommOSWork *work)
{
   if (running && aioWQ && work) {
      return QueueDelayedWork(aioWQ, work, 0);
   }
   return -1;
}
void
CommOS_ScheduleDisp(void)
{
	CommOSWork *work = &dispatchWorksNow[raw_smp_processor_id()];

	if (running)
		QueueDelayedWork(dispatchWQ, work, 0);
}
void
CommOS_ScheduleDisp(void)
{
   CommOSWork *work = &dispatchWorksNow[get_cpu()];

   put_cpu();
   if (running) {
      QueueDelayedWork(dispatchWQ, work, 0);
   }
}