Esempio n. 1
0
 public QueuedTask <T> QueueTask(CancellableAction <T> act)
 {
     if (_threadstop)
     {
         return(null);
     }
     lock (Queue) {
         if (_threadstop)
         {
             return(null);
         }
         var pd     = new ProgressDesciber();
         var queued = new QueuedTask <T>(act);
         Queue.Enqueue(queued);
         queued.State = TaskState.Queued;
         FireTaskQueued(queued);
         res.Set();
         return(queued);
     }
 }
Esempio n. 2
0
 public QueuedTask(CancellableAction <T> action)
 {
     Action   = Wrap(action);
     Progress = new ProgressDesciber();
     Token    = Progress.Token;
 }
Esempio n. 3
0
 public QueuedTask(CancellableAction <T> action, ProgressDesciber progress, CancellationToken token)
 {
     Action   = Wrap(action);
     Progress = progress;
     Token    = token;
 }
Esempio n. 4
0
 public QueuedTask(Action action)
 {
     Action   = Wrap(action);
     Progress = new ProgressDesciber();
     Token    = Progress.Token;
 }