N
Nathan
I'm trying to start a thread from the Application_Start event in
Global.asax. The thread is supposed to run some code, store the time it
ran in the database and then sleep for 24 hours.
My code is:
Dim jb as New DailyJob
Dim td as Thread
td = New Thread(AddressOf jb.Start)
td.Start()
My DailyJob class runs fine it I just normally execute it, but if I put
Trace.Write(Thread.ThreadState.ToString) it displays "Unstarted". Also,
if I place Trace.Writes in the constructor and Start method of the
DailyJob class they never display.
What would be causing my thread not to start, and is there any way of
checking if its active (something like
System.Threading.IsThreadActive(ThreadName))?
Global.asax. The thread is supposed to run some code, store the time it
ran in the database and then sleep for 24 hours.
My code is:
Dim jb as New DailyJob
Dim td as Thread
td = New Thread(AddressOf jb.Start)
td.Start()
My DailyJob class runs fine it I just normally execute it, but if I put
Trace.Write(Thread.ThreadState.ToString) it displays "Unstarted". Also,
if I place Trace.Writes in the constructor and Start method of the
DailyJob class they never display.
What would be causing my thread not to start, and is there any way of
checking if its active (something like
System.Threading.IsThreadActive(ThreadName))?