示例#1
0
        private void QueueTask(ControlTaskDispatcher.Task task)
        {
            Queue <ControlTaskDispatcher.Task> tasks = this.m_Tasks;

            lock (tasks)
            {
                this.m_Tasks.Enqueue(task);
                this.Wakeup();
            }
        }
示例#2
0
        public void ProcessMessage(IntPtr hWnd, ref Message m)
        {
            bool flag = this.m_hWnd == IntPtr.Zero;

            this.m_hWnd = hWnd;
            if (this.m_ProcessingTask)
            {
                return;
            }
            this.m_ProcessingTask = true;
            if (m.Msg == 1126 | flag)
            {
                Monitor.Enter(this.m_Tasks);
                while (this.m_Tasks.Count != 0)
                {
                    ControlTaskDispatcher.Task arg_5C_0 = this.m_Tasks.Dequeue();
                    Monitor.Exit(this.m_Tasks);
                    arg_5C_0.Do();
                    Monitor.Enter(this.m_Tasks);
                }
                Monitor.Exit(this.m_Tasks);
            }
            this.m_ProcessingTask = false;
        }