protected AsynchAgent(string nameSuffix) { Cts = new CancellationTokenSource(); var thisType = GetType(); type = thisType.Namespace + "." + thisType.Name; if (type.StartsWith("Orleans.", StringComparison.Ordinal)) { type = type.Substring(8); } if (!string.IsNullOrEmpty(nameSuffix)) { Name = type + "/" + nameSuffix; } else { Name = type; } Lockable = new object(); State = ThreadState.Unstarted; OnFault = FaultBehavior.IgnoreFault; Log = TraceLogger.GetLogger(Name, TraceLogger.LoggerType.Runtime); AppDomain.CurrentDomain.DomainUnload += CurrentDomain_DomainUnload; #if TRACK_DETAILED_STATS if (StatisticsCollector.CollectThreadTimeTrackingStats) { threadTracking = new ThreadTrackingStatistic(Name); } #endif t = new Thread(AgentThreadProc) { IsBackground = true, Name = this.Name }; }
protected AsynchAgent(string nameSuffix, ExecutorService executorService, ILoggerFactory loggerFactory) { this.executorService = executorService; Cts = new CancellationTokenSource(); var thisType = GetType(); type = thisType.Namespace + "." + thisType.Name; if (type.StartsWith("Orleans.", StringComparison.Ordinal)) { type = type.Substring(8); } if (!string.IsNullOrEmpty(nameSuffix)) { Name = type + "/" + nameSuffix; } else { Name = type; } Lockable = new object(); State = ThreadState.Unstarted; OnFault = FaultBehavior.IgnoreFault; Log = loggerFactory.CreateLogger(Name); AppDomain.CurrentDomain.DomainUnload += CurrentDomain_DomainUnload; #if TRACK_DETAILED_STATS if (StatisticsCollector.CollectThreadTimeTrackingStats) { threadTracking = new ThreadTrackingStatistic(Name); } #endif }
protected TaskSchedulerAgent(string nameSuffix, ILoggerFactory loggerFactory) { Cts = new CancellationTokenSource(); var thisType = GetType(); type = thisType.Namespace + "." + thisType.Name; if (type.StartsWith("Orleans.", StringComparison.Ordinal)) { type = type.Substring(8); } if (!string.IsNullOrEmpty(nameSuffix)) { Name = type + "/" + nameSuffix; } else { Name = type; } Lockable = new object(); OnFault = FaultBehavior.IgnoreFault; this.loggerFactory = loggerFactory; this.Log = loggerFactory.CreateLogger(Name); }
protected AsynchAgent(string nameSuffix, ExecutorService executorService, ILoggerFactory loggerFactory) { Cts = new CancellationTokenSource(); var thisType = GetType(); type = thisType.Namespace + "." + thisType.Name; if (type.StartsWith("Orleans.", StringComparison.Ordinal)) { type = type.Substring(8); } if (!string.IsNullOrEmpty(nameSuffix)) { Name = type + "/" + nameSuffix; } else { Name = type; } Lockable = new object(); State = ThreadState.Unstarted; OnFault = FaultBehavior.IgnoreFault; this.loggerFactory = loggerFactory; this.Log = loggerFactory.CreateLogger(Name); this.executorService = executorService; this.executorFaultHandler = new ExecutorFaultHandler(this); }
protected TaskSchedulerAgent(ILoggerFactory loggerFactory) { Cts = new CancellationTokenSource(); this.Log = loggerFactory.CreateLogger(this.GetType()); var typeName = GetType().FullName; if (typeName.StartsWith("Orleans.", StringComparison.Ordinal)) { typeName = typeName.Substring(8); } Name = typeName; Lockable = new object(); OnFault = FaultBehavior.IgnoreFault; }
protected AsynchAgent(string nameSuffix) { Cts = new CancellationTokenSource(); var thisType = GetType(); int n = 0; lock (classLockable) { SequenceNumbers.TryGetValue(thisType, out n); n++; SequenceNumbers[thisType] = n; } type = thisType.Namespace + "." + thisType.Name; if (type.StartsWith("Orleans.", StringComparison.Ordinal)) { type = type.Substring(8); } if (!string.IsNullOrEmpty(nameSuffix)) { Name = type + "." + nameSuffix + "/" + n; } else { Name = type + "/" + n; } Lockable = new object(); State = ThreadState.Unstarted; OnFault = FaultBehavior.IgnoreFault; Log = TraceLogger.GetLogger(Name, TraceLogger.LoggerType.Runtime); AppDomain.CurrentDomain.DomainUnload += new EventHandler(CurrentDomain_DomainUnload); #if TRACK_DETAILED_STATS if (StatisticsCollector.CollectThreadTimeTrackingStats) { threadTracking = new ThreadTrackingStatistic(Name); } #endif t = new Thread(AgentThreadProc) { IsBackground = true, Name = this.Name }; }
protected AsynchAgent(string nameSuffix) { Cts = new CancellationTokenSource(); var thisType = GetType(); type = thisType.Namespace + "." + thisType.Name; if (type.StartsWith("Orleans.", StringComparison.Ordinal)) { type = type.Substring(8); } if (!string.IsNullOrEmpty(nameSuffix)) { Name = type + "/" + nameSuffix; } else { Name = type; } Lockable = new object(); State = ThreadState.Unstarted; OnFault = FaultBehavior.IgnoreFault; Log = LogManager.GetLogger(Name, LoggerType.Runtime); #if !NETSTANDARD AppDomain.CurrentDomain.DomainUnload += CurrentDomain_DomainUnload; #endif #if TRACK_DETAILED_STATS if (StatisticsCollector.CollectThreadTimeTrackingStats) { threadTracking = new ThreadTrackingStatistic(Name); } #endif t = new Thread(AgentThreadProc) { IsBackground = true, Name = this.Name }; }