コード例 #1
0
        /// <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));
                }
            }
        }
コード例 #2
0
 /// <summary>
 /// Registers the thread monitor.
 /// </summary>
 /// <param name="threadMonitor">The thread monitor.</param>
 void IMonitorManager.RegisterThreadMonitor(IThreadMonitor threadMonitor)
 {
     if (threadMonitor == null)
     {
         throw new ArgumentNullException("threadMonitor");
     }
     this.ThreadMonitorFactory.Monitors.Add(threadMonitor);
 }
コード例 #3
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="log">IEventLog</param>
 /// <param name="threadIndex">Thread index</param>
 /// <param name="callMonitor">IThreadMonitor</param>
 /// <param name="raceDetectionEngine">IRaceDetectionEngine</param>
 /// <param name="configuration">Configuration</param>
 public ThreadExecutionMonitorDispatcher(IEventLog log, int threadIndex,
                                         IThreadMonitor callMonitor, IRegisterRuntimeOperation raceDetectionEngine, Configuration configuration)
     : base(threadIndex)
 {
     SafeDebug.AssertNotNull(callMonitor, "callMonitor");
     this.ThreadIndex   = threadIndex;
     this.Configuration = configuration;
     this.DebugTrace    = new SafeList <string>();
     this.CallStack     = new SafeStack <Method>();
     this.Reporter      = raceDetectionEngine;
 }
コード例 #4
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="log">IEventLog</param>
        /// <param name="threadIndex">Thread index</param>
        /// <param name="callMonitor">IThreadMonitor</param>
        /// <param name="testingEngine">ITestingEngine</param>
        /// <param name="configuration">Configuration</param>
        public ThreadExecutionMonitorDispatcher(IEventLog log, int threadIndex,
                                                IThreadMonitor callMonitor, ITestingEngine testingEngine, Configuration configuration)
            : base(threadIndex)
        {
            SafeDebug.AssertNotNull(callMonitor, "callMonitor");

            this.ThreadIndex   = threadIndex;
            this.Configuration = configuration;

            this.ThreadTrace = new List <ThreadTrace>();
            this.DebugTrace  = new SafeList <string>();
            this.CallStack   = new SafeStack <Method>();

            this.IsDoHandlerCalled     = false;
            this.IsEntryActionCalled   = false;
            this.IsExitActionCalled    = false;
            this.IsAction              = false;
            this.RecordRW              = false;
            this.IsCreateMachineMethod = false;

            // Registers a callback to emit the thread trace. The callback
            // is invoked at the end of each testing iteration.
            testingEngine.RegisterPerIterationCallBack(EmitThreadTrace);
        }
コード例 #5
0
ファイル: MonitorManager.cs プロジェクト: yonglehou/PSharp
        /// <summary>
        /// Registers the thread monitor.
        /// </summary>
        /// <param name="threadMonitor">IThreadMonitor</param>
        void IMonitorManager.RegisterThreadMonitor(IThreadMonitor threadMonitor)
        {
            if (threadMonitor == null)
            {
                throw new ArgumentNullException("threadMonitor");
            }

            this.ThreadMonitorFactory.Monitors.Add(threadMonitor);
        }
コード例 #6
0
        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="log">IEventLog</param>
        /// <param name="threadIndex">Thread index</param>
        /// <param name="callMonitor">IThreadMonitor</param>
        /// <param name="testingEngine">ITestingEngine</param>
        /// <param name="configuration">Configuration</param>
        public ThreadExecutionMonitorDispatcher(IEventLog log, int threadIndex,
            IThreadMonitor callMonitor, ITestingEngine testingEngine, Configuration configuration)
            : base(threadIndex)
        {
            SafeDebug.AssertNotNull(callMonitor, "callMonitor");

            this.ThreadIndex = threadIndex;
            this.Configuration = configuration;

            this.ThreadTrace = new List<ThreadTrace>();
            this.DebugTrace = new SafeList<string>();
            this.CallStack = new SafeStack<Method>();

            this.IsDoHandlerCalled = false;
            this.IsEntryActionCalled = false;
            this.IsExitActionCalled = false;
            this.IsAction = false;
            this.RecordRW = false;
            this.IsCreateMachineMethod = false;

            // Registers a callback to emit the thread trace. The callback
            // is invoked at the end of each testing iteration.
            testingEngine.RegisterPerIterationCallBack(EmitThreadTrace);
        }