..Net 1.1
On the currently executing thread, I create a new thread and start it. The
current thread waits for the new thread to complete execution or for a
timeout period. On timeout I call Thread.Abort on the new thread.
The new thread goes into a try - finally block in which it makes a remoting
call. I want the finally block to execute when I call thread abort, but the
thread is hung waiting for the remoting call to return and the finally code
never gets run.
What is going on here?
PsuedoCode:
CurrentThread
{
Thread newThread = Thread(new ThreadStart(NewThread))
bool timedout;
CompleteEvent.Wait(timeout, ref timedout)
if (timedout)
{
newThread.Abort()
}
}
NewThread()
{
try
{
RemoteObject.DoWork()
CompleteEvent.Signal
}
finally
{
CleanupCode
}
}
--
Howard Swope [hswopeATtrafficDOTcom]
Software Engineer
Media Development
Traffic.com [
http://www.traffic.com]