IThreadMain
Description
- Derived from
- Extended by
-
ThreadMainBase abstract
Tutorial_02_Mandelbrot sealed
Base interface for classes that provide a main method for a background thread.
Public / Methods
RequestStop
Signals the running thread main method to terminate gracefully.
This method is called exactly once; either when the Thread.Stop method is invoked for the first time or when the thread is disposed.
Run
This is the main method of the thread.
If this method throws an exception, the thread is terminated; the exception details can then be obtained via Thread.Error.
WaitingForStop
This method is invoked regularly when one thread has requested another one to stop and is waiting for its termination.
This callback allows a thread to perform actions while being blocked inside Thread.Join resp. IDisposable.Dispose (which implicitly joins on the thread), for example flushing buffers in order to avoid dead locks.