Exemplo n.º 1
0
 /// <summary>
 /// Create a worker thread, start it, Execute the runnable and terminate
 /// the thread (one time execution).
 /// </summary>
 internal WorkerThread(SimpleThreadPool tp, string name,
                       ThreadPriority prio, bool isDaemon, IThreadRunnable runnable)
     : base(name)
 {
     this.tp       = tp;
     this.runnable = runnable;
     if (runnable != null)
     {
         runOnce = true;
     }
     Priority     = prio;
     IsBackground = isDaemon;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Create a worker thread and start it. Waiting for the next Runnable,
 /// executing it, and waiting for the next Runnable, until the Shutdown
 /// flag is set.
 /// </summary>
 internal WorkerThread(SimpleThreadPool tp, string name,
                       ThreadPriority prio, bool isDaemon)
     : this(tp, name, prio, isDaemon, null)
 {
 }