public static Thread CreateSignalableThread(ISignalable toStart, object parameters, int stackSize)
        {
            Thread threadToStart = new Thread(toStart.startup, stackSize);

            threadToStart.Start(parameters);
            return(threadToStart);
        }
        public static Thread CreateSignalableThread(ISignalable toStart, int stackSize)
        {
            Thread threadToStart = new Thread(toStart.startup, stackSize);

            threadToStart.Start();
            return(threadToStart);
        }
 public static Task CreateSignalableTask(ISignalable toStart, CancellationToken token, object stateObject = null)
 {
     if (stateObject == null)
     {
         return(new Task(new Action(() => { toStart.startup(); }), token));
     }
     else
     {
         return(new Task(new Action <object>((object obj) => { toStart.SetState(obj); toStart.startup(); }), token));
     }
 }
 public static Task CreateSignalableTask(ISignalable toStart, TaskCreationOptions options, object stateObject = null)
 {
     if (stateObject == null)
     {
         return(new Task(new Action(() => { toStart.startup(); }), options));
     }
     else
     {
         return(new Task(new Action <object>((object obj) => { toStart.SetState(obj);  toStart.startup(); }), stateObject, options));
     }
 }
 public static Task CreateSignalableTask(ISignalable toStart, CancellationToken token)
 {
     return(new Task(new Action(() => { toStart.startup(); })));
 }
Beispiel #6
0
 public void Add(ISignalable s)
 {
     Add(s.GetFD());
 }