WorkerThread is an abstract base class extended by the Philosopher class to implement thread behavior.
Inheritance Hierarchy
LaurelBridge.DCFExamples.DiningPhilosophersWorkerThread
LaurelBridge.DCFExamples.DiningPhilosophersPhilosopher
Namespace: LaurelBridge.DCFExamples.DiningPhilosophers
Assembly: DiningPhilosophers (in DiningPhilosophers.exe) Version: DCF34 r13043 DCF_3_4_56_20220408 NetFramework
Syntax
C#
public abstract class WorkerThread
The WorkerThread type exposes the following members.
Constructors
Name | Description | |
---|---|---|
WorkerThread |
Constructor with optional data.
|
Properties
Name | Description | |
---|---|---|
Data |
The data passed to this on construction or null.
| |
IsAlive |
Return true if the worker thread is alive.
| |
StopRequested |
When true, the philosopher was requested to stop eating before finishing his food.
|
Methods
Name | Description | |
---|---|---|
Join |
Join this thread with optional timeout.
| |
Run |
To be implemented by derived threads
| |
Start |
Start the worker thread
| |
Stop |
Stop the current thread by setting a flag. We rely on the thread to stop.
|
See Also