public GroupThread(ThreadGroup owner) { Owner = owner; WakeEvent = new ManualResetEventSlim(true); Thread = new Thread(ThreadMain); Thread.Name = string.Format("ThreadGroup {0} worker #{1}", owner.GetHashCode(), owner.Count); Thread.IsBackground = owner.CreateBackgroundThreads; if (owner.COMThreadingModel != ApartmentState.Unknown) { Thread.SetApartmentState(owner.COMThreadingModel); } owner.RegisterQueuesForNewThread(this); Thread.Start(this); }
internal GroupThread(ThreadGroup owner, int index) { Owner = owner; NextQueueIndex = index; Thread = new Thread(ThreadMain); Name = string.Format($"{owner.Name} worker #{index} [ThreadGroup {owner.GetHashCode():X8}]"); Thread.Name = Name; Thread.IsBackground = owner.CreateBackgroundThreads; if (owner.COMThreadingModel != ApartmentState.Unknown) { Thread.SetApartmentState(owner.COMThreadingModel); } Thread.Start(this); }