/// <summary> /// Constructor /// </summary> public ThreadExecutionMonitorDispatcher(IEventLog log, int threadIndex, IThreadMonitor callMonitor) : base(threadIndex) { SafeDebug.AssertNotNull(callMonitor, "callMonitor"); this.log = log; this.threadIndex = threadIndex; this.callMonitor = callMonitor; this.callStack = new SafeLinkedList <CallFrame>(); this.current = new CallFrame(default(ICallFrame), default(Method), 0); //fake caller. this.callStack.AddFirst(new SafeLinkedList <CallFrame> .Node(this.current)); if (firstTime) { // get rid of all [T] from types and methods var env = MyEngine.EnvironmentVars; firstTime = false; foreach (var t in env.DontPreemptTypes) { newDontPreemptTypes.Add(eliminateParameterizedTypes(t)); } foreach (var m in env.DontPreemptMethods) { newDontPreemptMethods.Add(eliminateParameterizedTypes(m)); } foreach (var m in env.PrioritizeMethods) { newPrioritizeMethods.Add(eliminateParameterizedTypes(m)); } } }
/// <summary> /// 初始化任务管理器的新实例。 /// </summary> public TaskManager() { m_Tasks = new SafeLinkedList <TaskBase>(); m_Serial = 0; }