コード例 #1
0
ファイル: GroupThread.cs プロジェクト: jli94/Fracture
 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);
 }
コード例 #2
0
ファイル: GroupThread.cs プロジェクト: sq/Libraries
 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);
 }