I am trying to figure out a way to verify that a BackgroundWorker thread is alive (i.e. still running. The thread is essentially implemented as a simple infinite loop:
while (AllConditionsMet())
{
DoSomeMagic();
Thread.Sleep(10000);
}
The closest thing to IsAlive()
I found so far is the IsBusy property, but given that my thread Sleep()s most of the time, I am not sure whether this will do the job.
Can I count on IsBusy to do:
if (!myWorker.IsBusy)
RestartWorker();
or am I calling for trouble?