예제 #1
0
        public void Dispose(bool dispose)
        {
            UIThread.MustBeCalledFromUIThread();
            lock (queueLock) {
                if (!this.isDisposed)
                {
                    if (dispose)
                    {
                        TaskReporterIdleRegistration.Unregister(this.token);
                        FinishProcessingQueue();
                        foreach (TaskInfo ti in this.backgroundTasks)
                        {
                            ti.Dispose();
                        }

                        foreach (TaskInfo ti in this.buildTasks)
                        {
                            ti.Dispose();
                        }

                        this.ClearAllTasks();

                        if (null != this.taskListProvider)
                        {
                            this.taskListProvider.Refresh();
                            this.taskListProvider.Clear();
                        }
                    }
                    this.buildTasks       = null;
                    this.backgroundTasks  = null;
                    this.taskListProvider = null;
                    this.isDisposed       = true;
                }
            }
        }
예제 #2
0
        public TaskReporter(string debugDescription)
        {
#if DEBUG
            Interlocked.Increment(ref AliveCount);
#endif
            this.taskListProvider = null;
            this.debugDescription = debugDescription;

            this.backgroundTasks = new LinkedList <TaskInfo>();
            this.buildTasks      = new LinkedList <TaskInfo>();

            this.maxErrors  = 200;
            this.isDisposed = false;

            this.queueLock = new object();
            this.work      = new Queue <Action>();
            this.token     = TaskReporterIdleRegistration.Register(this);
        }