C# Class BitSharper.Threading.Execution.ThreadPoolExecutor.Worker

Class Worker mainly maintains interrupt control state for threads running tasks, along with other minor bookkeeping. This class opportunistically extends ReentrantLock to simplify acquiring and releasing a lock surrounding each task execution. This protects against interrupts that are intended to wake up a worker thread waiting for a task from instead interrupting a task being run.
Inheritance: BitSharper.Threading.Locks.ReentrantLock, IRunnable
Afficher le fichier Open project: TangibleCryptography/BitSharper

Protected Properties

Свойство Type Description
CompletedTasks uint
FirstTask IRunnable
Thread Thread

Méthodes publiques

Méthode Description
Run ( ) : void

Runs the associated task, signalling the ThreadPoolExecutor when exiting.

Private Methods

Méthode Description
Worker ( ThreadPoolExecutor parentThreadPoolExecutor, IRunnable firstTask ) : System

Default Constructor

Method Details

Run() public méthode

Runs the associated task, signalling the ThreadPoolExecutor when exiting.
public Run ( ) : void
Résultat void

Property Details

CompletedTasks protected_oe property

Per thread completed task counter; accumulated into completedTaskCount upon termination.
protected uint CompletedTasks
Résultat uint

FirstTask protected_oe property

Initial task to run before entering run loop
protected IRunnable FirstTask
Résultat IRunnable

Thread protected_oe property

Thread this worker is running in. Acts as a final field, but cannot be set until thread is created.
protected Thread Thread
Résultat Thread