Exemplo n.º 1
0
 /// <summary> Queues call to constructor supplied
 /// delegate with user supplied object.  This method
 /// blocks if maximum queue size is reached.  </summary>
 public void QueueUserWorkItem(IThreadStart command)
 {
     Monitor.Enter(this.monitor);
     while (this.queuedItems == this.maxQueuedItems)
     {
         Monitor.Wait(this.monitor);
     }
     commands.Enqueue(command);
     this.queuedItems++;
     Monitor.Pulse(this.monitor);
     Monitor.Exit(this.monitor);
 }
Exemplo n.º 2
0
 public Thread(IThreadStart iThreadStart)
 {
     this.iThreadStart = iThreadStart;
 }
Exemplo n.º 3
0
 public void AddTask(IThreadStart runnable, DateTime?runTime = null)
 {
     AddTask(runnable.Run, runTime);
 }