C# Class CqlSharp.Threading.ActiveThreadScheduler

Runs all tasks on the thread used to create the scheduler
Inheritance: System.Threading.Tasks.TaskScheduler
ファイルを表示 Open project: reuzel/CqlSharp

Public Methods

Method Description
ActiveThreadScheduler ( ) : System

Initializes a new instance of the ActiveThreadScheduler class.

ActiveThreadScheduler ( Thread thread ) : System

Initializes a new instance of the ActiveThreadScheduler class.

Complete ( ) : void

Signal to this scheduler that no more tasks are expected to arrive on this scheduler

ExecuteTasks ( ) : void

Start execution of tasks Scheduled to this scheduler.

Protected Methods

Method Description
GetScheduledTasks ( ) : IEnumerable

For debugger support only, generates an enumerable of T:System.Threading.Tasks.Task instances currently queued to the scheduler waiting to be executed.

QueueTask ( Task task ) : void

Queues a T:System.Threading.Tasks.Task to the scheduler.

TryExecuteTaskInline ( Task task, bool taskWasPreviouslyQueued ) : bool

Determines whether the provided T:System.Threading.Tasks.Task can be executed synchronously in this call, and if it can, executes it.

Private Methods

Method Description
TryTake ( Task &task ) : bool

Tries to take the first task from the set. This operation will block until an task has become available, or no more additions are expected.

Method Details

ActiveThreadScheduler() public method

Initializes a new instance of the ActiveThreadScheduler class.
public ActiveThreadScheduler ( ) : System
return System

ActiveThreadScheduler() public method

Initializes a new instance of the ActiveThreadScheduler class.
thread
public ActiveThreadScheduler ( Thread thread ) : System
thread Thread The thread.
return System

Complete() public method

Signal to this scheduler that no more tasks are expected to arrive on this scheduler
public Complete ( ) : void
return void

ExecuteTasks() public method

Start execution of tasks Scheduled to this scheduler.
/// Execute must be called using the same thread as used to construct /// this scheduler ///
public ExecuteTasks ( ) : void
return void

GetScheduledTasks() protected method

For debugger support only, generates an enumerable of T:System.Threading.Tasks.Task instances currently queued to the scheduler waiting to be executed.
/// This scheduler is unable to generate a list of queued tasks at this /// time. ///
protected GetScheduledTasks ( ) : IEnumerable
return IEnumerable

QueueTask() protected method

Queues a T:System.Threading.Tasks.Task to the scheduler.
The argument is null.
protected QueueTask ( Task task ) : void
task Task The to be queued.
return void

TryExecuteTaskInline() protected method

Determines whether the provided T:System.Threading.Tasks.Task can be executed synchronously in this call, and if it can, executes it.
The argument is null. The was already executed.
protected TryExecuteTaskInline ( Task task, bool taskWasPreviouslyQueued ) : bool
task Task The to be executed.
taskWasPreviouslyQueued bool /// A Boolean denoting whether or not task has previously been queued. If this /// parameter is True, then the task may have been previously queued (scheduled); if False, then the task is known not to /// have been queued, and this call is being made in order to execute the task inline without queuing it. ///
return bool