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

◆ SpinThenBlockingWait()

bool System.Threading.Tasks.Task< TResult >.SpinThenBlockingWait ( int millisecondsTimeout,
CancellationToken cancellationToken )
inlineprivateinherited

Definition at line 2361 of file Task.cs.

2362 {
2363 bool flag = millisecondsTimeout == -1;
2364 uint num = ((!flag) ? ((uint)Environment.TickCount) : 0u);
2366 if (!flag2)
2367 {
2368 SetOnInvokeMres setOnInvokeMres = new SetOnInvokeMres();
2369 try
2370 {
2372 if (flag)
2373 {
2374 bool flag3 = ThreadPool.NotifyThreadBlocked();
2375 try
2376 {
2378 }
2379 finally
2380 {
2381 if (flag3)
2382 {
2383 ThreadPool.NotifyThreadUnblocked();
2384 }
2385 }
2386 }
2387 else
2388 {
2389 uint num2 = (uint)Environment.TickCount - num;
2391 {
2392 bool flag4 = ThreadPool.NotifyThreadBlocked();
2393 try
2394 {
2396 }
2397 finally
2398 {
2399 if (flag4)
2400 {
2401 ThreadPool.NotifyThreadUnblocked();
2402 }
2403 }
2404 }
2405 }
2406 }
2407 finally
2408 {
2409 if (!IsCompleted)
2410 {
2412 }
2413 }
2414 }
2415 return flag2;
2416 }
bool SpinWait(int millisecondsTimeout)
Definition Task.cs:2418
void AddCompletionAction(ITaskCompletionAction action, bool addBeforeOthers=false)
Definition Task.cs:2952
void RemoveContinuation(object continuationObject)
Definition Task.cs:3005

References System.Threading.Tasks.Task< TResult >.AddCompletionAction(), System.cancellationToken, System.Threading.Tasks.Task< TResult >.IsCompleted, System.millisecondsTimeout, System.Threading.ThreadPool.NotifyThreadBlocked(), System.Threading.ThreadPool.NotifyThreadUnblocked(), System.Threading.Tasks.Task< TResult >.RemoveContinuation(), System.Threading.Tasks.Task< TResult >.SpinWait(), and System.Environment.TickCount.

Referenced by System.Threading.Tasks.Task< TResult >.InternalRunSynchronously(), and System.Threading.Tasks.Task< TResult >.InternalWaitCore().