Exemplo n.º 1
0
 /// <summary>
 /// Creates a thread fiber.
 /// </summary>
 /// <param name="queue"></param>
 /// <param name="threadName"></param>
 /// <param name="isBackground"></param>
 /// <param name="priority"></param>
 public ThreadFiber(IQueue queue, string threadName, bool isBackground = true, ThreadPriority priority = ThreadPriority.Normal)
 {
     _queue = queue;
     _thread = new Thread(RunThread);
     _thread.Name = threadName;
     _thread.IsBackground = isBackground;
     _thread.Priority = priority;
     _scheduler = new Scheduler(this);
 }
Exemplo n.º 2
0
 public BaseFiber()
 {
     _scheduler = new Scheduler(this);
 }
Exemplo n.º 3
0
 /// <summary>
 /// Creates an instance.
 /// </summary>
 public GuiFiber(IExecutionContext executionContext, IExecutor executor)
 {
     _timer = new Scheduler(this);
     _executionContext = executionContext;
     _executor = executor;
 }
Exemplo n.º 4
0
 /// <summary>
 /// Construct new instance.
 /// </summary>
 /// <param name="pool"></param>
 /// <param name="executor"></param>
 public PoolFiber(IThreadPool pool, IExecutor executor)
 {
     _timer = new Scheduler(this);
     _pool = pool;
     _executor = executor;
 }
Exemplo n.º 5
0
 /// <summary>
 /// Creates a thread fiber.
 /// </summary>
 /// <param name="queue"></param>
 /// <param name="threadName"></param>
 /// <param name="isBackground"></param>
 /// <param name="priority"></param>
 public ThreadFiber(IQueue queue, Func<Action, IThread> threadCreator)
 {
     _queue = queue;
     _thread = threadCreator(RunThread);
     _scheduler = new Scheduler(this);
 }