void InitializeEnv(int threadCount, int operationCount, int buggyClientCount, double probFailurePerOperation, double probBuggyOnErrorHandlerFailure) { SafeClient = new SafeClient(); _random = new Random(); _buggyClients = new List <BuggyClient>(); _contexts = new List <ThreadContext>(); _probFailurePerOperation = probFailurePerOperation; for (int i = 0; i < threadCount; ++i) { _contexts.Add(new ThreadContext(this, _contexts.Count, buggyClientCount, operationCount)); } _inSafeErrorHandler = false; _maxNumberOfErrorReceivedAtOnce = 0; _lastSequenceNumberReceived = ActivityMonitor.CriticalErrorCollector.NextSequenceNumber - 1; _errorsFromBackground = new ConcurrentBag <string>(); _probBuggyOnErrorHandlerFailure = probBuggyOnErrorHandlerFailure; _buggyOnErrorHandlerFailCount = 0; _buggyOnErrorHandlerReceivedCount = 0; _nbClearedWhileRaised = 0; _nbNotClearedWhileRaised = 0; }
void InitializeEnv( int threadCount, int operationCount, int buggyClientCount, double probFailurePerOperation, double probBuggyOnErrorHandlerFailure ) { SafeClient = new SafeClient(); _random = new Random(); _buggyClients = new List<BuggyClient>(); _contexts = new List<ThreadContext>(); _probFailurePerOperation = probFailurePerOperation; for( int i = 0; i < threadCount; ++i ) _contexts.Add( new ThreadContext( this, _contexts.Count, buggyClientCount, operationCount ) ); _inSafeErrorHandler = false; _maxNumberOfErrorReceivedAtOnce = 0; _lastSequenceNumberReceived = ActivityMonitor.CriticalErrorCollector.NextSequenceNumber - 1; _errorsFromBackground = new ConcurrentBag<string>(); _probBuggyOnErrorHandlerFailure = probBuggyOnErrorHandlerFailure; _buggyOnErrorHandlerFailCount = 0; _buggyOnErrorHandlerReceivedCount = 0; _nbClearedWhileRaised = 0; _nbNotClearedWhileRaised = 0; }