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

◆ AtomicStateUpdate() [4/4]

bool System.Threading.Tasks.Task< TResult >.AtomicStateUpdate ( int newBits,
int illegalBits,
ref int oldFlags )
inlinepackageinherited

Definition at line 1407 of file Task.cs.

1408 {
1409 int num = (oldFlags = m_stateFlags);
1410 while (true)
1411 {
1412 if ((num & illegalBits) != 0)
1413 {
1414 return false;
1415 }
1416 oldFlags = Interlocked.CompareExchange(ref m_stateFlags, num | newBits, num);
1417 if (oldFlags == num)
1418 {
1419 break;
1420 }
1421 num = oldFlags;
1422 }
1423 return true;
1424 }
volatile int m_stateFlags
Definition Task.cs:954

References System.Threading.Interlocked.CompareExchange(), and System.Threading.Tasks.Task< TResult >.m_stateFlags.