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

◆ NotifyThreadBlocked()

bool System.Threading.PortableThreadPool.NotifyThreadBlocked ( )
inline

Definition at line 1608 of file PortableThreadPool.cs.

1609 {
1610 if (!BlockingConfig.IsCooperativeBlockingEnabled || !Thread.CurrentThread.IsThreadPoolThread)
1611 {
1612 return false;
1613 }
1614 bool flag = false;
1616 try
1617 {
1619 if (_pendingBlockingAdjustment != PendingBlockingAdjustment.WithDelayIfNecessary && _separated.counts.NumThreadsGoal < TargetThreadsGoalForBlockingAdjustment)
1620 {
1621 if (_pendingBlockingAdjustment == PendingBlockingAdjustment.None)
1622 {
1623 flag = true;
1624 }
1625 _pendingBlockingAdjustment = PendingBlockingAdjustment.WithDelayIfNecessary;
1626 }
1627 }
1628 finally
1629 {
1631 }
1632 if (flag)
1633 {
1634 GateThread.Wake(this);
1635 }
1636 return true;
1637 }
PendingBlockingAdjustment _pendingBlockingAdjustment

References System.Threading.PortableThreadPool._numBlockedThreads, System.Threading.PortableThreadPool._pendingBlockingAdjustment, System.Threading.PortableThreadPool._separated, System.Threading.PortableThreadPool._threadAdjustmentLock, System.Threading.LowLevelLock.Acquire(), System.Threading.PortableThreadPool.CacheLineSeparated.counts, System.Threading.Thread.CurrentThread, System.Threading.PortableThreadPool.BlockingConfig.IsCooperativeBlockingEnabled, System.Threading.PortableThreadPool.ThreadCounts.NumThreadsGoal, System.Threading.LowLevelLock.Release(), System.Threading.PortableThreadPool.TargetThreadsGoalForBlockingAdjustment, and System.Threading.PortableThreadPool.GateThread.Wake().