internal ActivationTaskScheduler(WorkItemGroup workGroup) { myId = Interlocked.Increment(ref idCounter); workerGroup = workGroup; #if EXTRA_STATS turnsExecutedStatistic = CounterStatistic.FindOrCreate(name + ".TasksExecuted"); #endif if (logger.IsVerbose) logger.Verbose("Created {0} with SchedulingContext={1}", this, workerGroup.SchedulingContext); }
// Only required if you have work groups flagged by a context that is not a WorkGroupingContext public WorkItemGroup RegisterWorkContext(ISchedulingContext context) { if (context == null) return null; var wg = new WorkItemGroup(this, context); workgroupDirectory.TryAdd(context, wg); return wg; }