I want to implement interruptable tasks based on background threads. What is the cleanest way to implement the TTask.Stop
method? How can I abort the background thread?
The code executed within the thread context is passed to the task using an anonymous method and can contain blocking calls, so I can't rely on the fact, that the Terminated
flag is checked regularly from within the code.
Thanks for any input.
Using D2010 in case it matters (some things in TThread
seem to have changed)