public static void StartScheduler()
{
if (sOutstandingTasks == 0)
throw new InvalidOperationException("At least one task should be added with AddTask() before calling StartSched().");
using (new CoopSyncContext())
{
Tuple<SendOrPostCallback, object> tup;
while (sCallbacks.TryTake(out tup, Timeout.Infinite))
tup.Item1(tup.Item2);
}
}