C# Class Microsoft.UnitTests.Core.Threading.ControlledTaskScheduler

Inheritance: System.Threading.Tasks.TaskScheduler
Mostrar archivo Open project: Microsoft/RTVS Class Usage Examples

Public Methods

Method Description
ControlledTaskScheduler ( SynchronizationContext syncContext ) : System
GetAwaiter ( ) : TaskAwaiter
Pause ( ) : IDisposable
Wait ( ) : void

Waits until scheduler queue is empty

WaitForUpcomingTasks ( int ms = 1000 ) : void

Waits for tasks to be scheduled and then until scheduler queue is empty If there are tasks in the queue already, behaves similar to Wait().

Private Methods

Method Description
AfterTaskExecuted ( Task task ) : void
Callback ( Task task ) : void
GetScheduledTasks ( ) : IEnumerable
QueueTask ( Task task ) : void
Resume ( ) : void
TryExecuteTaskInline ( Task task, bool taskWasPreviouslyQueued ) : bool

Method Details

ControlledTaskScheduler() public method

public ControlledTaskScheduler ( SynchronizationContext syncContext ) : System
syncContext System.Threading.SynchronizationContext
return System

GetAwaiter() public method

public GetAwaiter ( ) : TaskAwaiter
return TaskAwaiter

Pause() public method

public Pause ( ) : IDisposable
return IDisposable

Wait() public method

Waits until scheduler queue is empty
public Wait ( ) : void
return void

WaitForUpcomingTasks() public method

Waits for tasks to be scheduled and then until scheduler queue is empty If there are tasks in the queue already, behaves similar to Wait().
public WaitForUpcomingTasks ( int ms = 1000 ) : void
ms int /// Number of milliseconds to wait until task is scheduled. /// Should be greater than 0. /// Default value is 1000ms. ///
return void