DispatcherOperation task;
lock (q){
+ // if we are done with this queue, leave.
+ if (q.Count == 0){
+ queue_bits &= ~current_bit;
+ break;
+ }
task = (DispatcherOperation) q.Dequeue ();
}
PerformShutdown ();
return;
}
-
- // if we are done with this queue, leave.
- lock (q){
- if (q.Count == 0){
- queue_bits &= ~(1 << i);
- break;
- }
- }
//
// If a higher-priority task comes in, go do that
//
if (current_bit < (queue_bits & ~current_bit))
+ {
+ i = TOP_PRIO + 1; // for-loop decreases by one
break;
+ }
} while (true);
}
}