wellhole
asked on
Thread Abort and Join
I'm trying to abort and join onto a thread so that I don't write over the new thread work with the old thread work. But, its not behaving nicely. For some reason, Abort() and Join() isn't waiting for the Finally block to end. Any ideas?
Private t as Thread = Nothing
Sub StartThread()
If Not t Is Nothing Then
Console.WriteLine("Abort")
t.Abort()
t.Join()
End If
Console.WriteLine("New")
t = New Thread(AddressOf SomeFunction)
t.IsBackground = True
t.Start()
End Sub
Sub SomeFunction()
Try
' Do stuff
Catch
' Ignore
Finally
' Free up resources
Console.WriteLine("Finally")
End Try
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Ahh. I screwed up on this question. I'm going to start over with a better description.
ASKER