Exemplo n.º 1
0
            /// <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();
            }
Exemplo n.º 2
0
            /// <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();
            }
Exemplo n.º 3
0
            /// <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();
                }
            }