Restar after crash

Dec 21 2009 11:36 AM

Hello all,
My question is as follows, I have one Workflow that uses an explicitly created thread, it is sleeping since it was created until the time it should execute its payload. My question is: How can I restore that thread after a process crash/failure when the process restarts its execution? Its running under aspnet. Is there any way to acomplish this task without saving the unfinished threads in the database and restore them when the system restarts?
Here is one example of the code
private
void WFStateActivationTrigger()
{
DateTime inicio = DateTime.Now.ToUniversalTime().AddSeconds(20);
TimeSpan tiempoEspera = inicio.Subtract(DateTime.Now.ToUniversalTime());
Thread.Sleep(tiempoEspera);
WorkflowEvents.Default.RaiseEvent(this.WorkflowInstanceId.ToString(), (int)Event.PcActivationDone);
}
 
called at...
Thread
hilo = new Thread(new ThreadStart(WFStateActivationTrigger));
hilo.Start();
..

Thank you