private void Scheduler(object data)
        {
            // schedule root task
            FiberTask rootTask = (FiberTask)data;

            _scheduler = this;

            _schedulerFiberId = FiberUnmanaged.ConvertThreadToFiber(0);

            rootTask.Start();
            SwitchTask();

            // exit
            FiberUnmanaged.ConvertFiberToThread();
        }
 internal void StopTask(FiberTask task)
 {
     _stoppedTasks.Add(task);
 }
 internal void StartTask(FiberTask task)
 {
     _readyTasks.Enqueue(task);
 }
 public FiberTaskScheduler(FiberTask rootTask)
 {
     _thread = new Thread(Scheduler);
     _thread.Start(rootTask);
 }
 internal void StopTask(FiberTask task)
 {
     _stoppedTasks.Add(task);
 }
 internal void StartTask(FiberTask task)
 {
     _readyTasks.Enqueue(task);
 }
 public FiberTaskScheduler(FiberTask rootTask)
 {
     _thread = new Thread(Scheduler);
     _thread.Start(rootTask);
 }