/// <summary> /// Construct and start a thread for the given queue /// </summary> /// <param name="queue"></param> public MamaQueueThread(MamaQueue queue) { this.queue = queue; queue.setEnqueueCallback(this); workerThread = new Thread(new ThreadStart(this.run)); workerThread.Name = "MamaQueueManager:" + queue.GetHashCode(); workerThread.Start(); }
/// <summary> /// Construct and start a thread for the given queue /// </summary> /// <param name="queue"></param> public MamaQueueThread(MamaQueue queue) { this.queue = queue; queue.setEnqueueCallback(this); workerThread = new Thread(new ThreadStart(this.run)); workerThread.Name = "MamaQueueManager:"+queue.GetHashCode(); workerThread.Start(); }
/// <summary> /// Start dispatching on the queue, this creates a new worker thread. /// </summary> internal void start() { // Only continue if the thread is not valid if (null == mWorkerThread) { // Create the thread mWorkerThread = new Thread(new ThreadStart(this.workerThreadProc)); // It will run in the background mWorkerThread.IsBackground = true; // Format the name with the queue hash code mWorkerThread.Name = string.Format("MamaQueueManager: {0}", mQueue.GetHashCode()); // Start the thread mWorkerThread.Start(); } }