System.Threading.Tasks.ThreadWorker.InitializeUnderlyingThread C# (CSharp) Method

InitializeUnderlyingThread() static private method

static private InitializeUnderlyingThread ( int maxStackSize, ThreadPriority priority ) : void
maxStackSize int
priority ThreadPriority
return void
		void InitializeUnderlyingThread (int maxStackSize, ThreadPriority priority)
		{
			threadInitializer = delegate {
				// Special case of the participant ThreadWorker
				if (isLocal) {			
					this.workerThread = Thread.CurrentThread;
					return;
				}
				
				this.workerThread = (maxStackSize == 0) ? new Thread (WorkerMethodWrapper) :
					new Thread (WorkerMethodWrapper, maxStackSize);
	
				this.workerThread.IsBackground = true;
				this.workerThread.Priority = priority;
			};
			threadInitializer ();
		}