Austin.LibTaskNet.CoopScheduler.StartScheduler C# (CSharp) Method

StartScheduler() public static method

Starts executing tasks and does not return until all tasks have completed execution.
If a scheduled task throws an exception, it will be raised here. If no tasks are scheduled, an exception will be thrown.
public static StartScheduler ( ) : void
return void
        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);
            }
        }