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

◆ InternalWaitCore()

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

Definition at line 2330 of file Task.cs.

2331 {
2332 if (IsCompleted)
2333 {
2334 return true;
2335 }
2336 TplEventSource log = TplEventSource.Log;
2337 bool flag = log.IsEnabled();
2338 if (flag)
2339 {
2341 log.TaskWaitBegin(internalCurrent?.m_taskScheduler.Id ?? TaskScheduler.Default.Id, internalCurrent?.Id ?? 0, Id, TplEventSource.TaskWaitBehavior.Synchronous, 0);
2342 }
2344 bool result = (millisecondsTimeout == -1 && !cancellationToken.CanBeCanceled && WrappedTryRunInline() && IsCompleted) || SpinThenBlockingWait(millisecondsTimeout, cancellationToken);
2345 if (flag)
2346 {
2348 if (internalCurrent2 != null)
2349 {
2350 log.TaskWaitEnd(internalCurrent2.m_taskScheduler.Id, internalCurrent2.Id, Id);
2351 }
2352 else
2353 {
2354 log.TaskWaitEnd(TaskScheduler.Default.Id, 0, Id);
2355 }
2356 log.TaskWaitContinuationComplete(Id);
2357 }
2358 return result;
2359 }
static void NotifyOfCrossThreadDependency()
Definition Debugger.cs:44
TaskScheduler m_taskScheduler
Definition Task.cs:952
static ? Task InternalCurrent
Definition Task.cs:1011
bool SpinThenBlockingWait(int millisecondsTimeout, CancellationToken cancellationToken)
Definition Task.cs:2361

References System.cancellationToken, System.Threading.Tasks.TaskScheduler.Default, System.Threading.Tasks.Task< TResult >.Id, System.Threading.Tasks.TaskScheduler.Id, System.Threading.Tasks.Task< TResult >.InternalCurrent, System.Threading.Tasks.Task< TResult >.IsCompleted, System.Threading.Tasks.TplEventSource.Log, System.Threading.Tasks.Task< TResult >.m_taskScheduler, System.millisecondsTimeout, System.Diagnostics.Debugger.NotifyOfCrossThreadDependency(), System.Threading.Tasks.Task< TResult >.SpinThenBlockingWait(), and System.Threading.Tasks.Task< TResult >.WrappedTryRunInline().

Referenced by System.Threading.Tasks.Task< TResult >.InternalWait().