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

◆ Enqueue()

void System.Threading.ThreadPoolWorkQueue.Enqueue ( object callback,
bool forceGlobal )
inline

Definition at line 430 of file ThreadPoolWorkQueue.cs.

431 {
432 if (loggingEnabled && FrameworkEventSource.Log.IsEnabled())
433 {
434 FrameworkEventSource.Log.ThreadPoolEnqueueWorkObject(callback);
435 }
436 ThreadPoolWorkQueueThreadLocals threadPoolWorkQueueThreadLocals = null;
437 if (!forceGlobal)
438 {
439 threadPoolWorkQueueThreadLocals = ThreadPoolWorkQueueThreadLocals.threadLocals;
440 }
441 if (threadPoolWorkQueueThreadLocals != null)
442 {
443 threadPoolWorkQueueThreadLocals.workStealingQueue.LocalPush(callback);
444 }
445 else
446 {
447 workItems.Enqueue(callback);
448 }
450 }
readonly ConcurrentQueue< object > workItems

References System.Collections.Concurrent.ConcurrentQueue< T >.Enqueue(), System.Threading.ThreadPoolWorkQueue.EnsureThreadRequested(), System.Diagnostics.Tracing.FrameworkEventSource.Log, System.Threading.ThreadPoolWorkQueue.loggingEnabled, System.Threading.ThreadPoolWorkQueueThreadLocals.threadLocals, System.Threading.ThreadPoolWorkQueue.workItems, and System.Threading.ThreadPoolWorkQueueThreadLocals.workStealingQueue.

Referenced by System.Threading.ThreadPoolWorkQueueThreadLocals.TransferLocalWork().