I have an object in a worker thread, which I can instruct to stop running. I can implement this using a bool or an AutoResetEvent:
boolean:
private v
IMHO the AutoResetEvent is better, because you can't forget the crucial volatile keyword in this case.
AutoResetEvent
volatile