IThreadMain

Description

interface Tinman.Core.Threading.IThreadMain

Derived from

IDisposable

Extended by

ThreadMainBase abstract
Tutorial_02_Mandelbrot sealed

Base interface for classes that provide a main method for a background thread.

Public / Methods

RequestStop


public method 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


[ThrowAny]
public method Run → (1)

context in : ThreadContext

[not-null]
The thread context object.

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


public method 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.