Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ QueueUserWorkItem< TState >()

static bool System.Threading.ThreadPool.QueueUserWorkItem< TState > ( Action< TState > callBack,
TState state,
bool preferLocal )
inlinestatic

Definition at line 515 of file ThreadPool.cs.

516 {
517 if (callBack == null)
518 {
519 ThrowHelper.ThrowArgumentNullException(ExceptionArgument.callBack);
520 }
521 ExecutionContext executionContext = ExecutionContext.Capture();
522 object callback = ((executionContext == null || executionContext.IsDefault) ? ((QueueUserWorkItemCallbackBase)new QueueUserWorkItemCallbackDefaultContext<TState>(callBack, state)) : ((QueueUserWorkItemCallbackBase)new QueueUserWorkItemCallback<TState>(callBack, state, executionContext)));
523 s_workQueue.Enqueue(callback, !preferLocal);
524 return true;
525 }
static readonly ThreadPoolWorkQueue s_workQueue
Definition ThreadPool.cs:16

References System.callBack, System.Threading.ExecutionContext.Capture(), System.Threading.ThreadPool.s_workQueue, System.state, and System.ThrowHelper.ThrowArgumentNullException().