internal void Start()
{
thread = dispatcher.maxThreadStackSize == 0 ? new Thread (this.Run) : new Thread (this.Run, dispatcher.maxThreadStackSize);
thread.Name = String.Format ("{0} ThreadPoolThread ID: {1}", dispatcher.Name, this.currentQueue);
thread.Priority = dispatcher.priority;
thread.IsBackground = (dispatcher.options & DispatcherOptions.UseBackgroundThreads) != 0;
if (dispatcher.state.HasValue)
thread.SetApartmentState (dispatcher.state.Value);
thread.Start ();
}
internal void SpawnWorker() { lock (_lock) { if (workers.Count >= maxThreads) return; var w = new CcrWorker (this, queues.Length); workers.Add (w); w.Start (); } }