A bug in Abort()?
Luca Marchesi <[email protected]> Sat, 22 Jun 2002 11:54:20 +0200
| Newsgroups | gmane.comp.windows.devel.dotnet.general |
|---|---|
| Message-ID | <003201c219d3$051c2680$7a0a1b97@pentium2> |
Hy everybody.
The SDK says
" If Abort is called on a thread that has been suspended, the thread is resumed and then aborted. "
But if I suspend and abort a thread I obtain a ThreadSTateExcpetion
"An unhandled exception of type 'System.Threading.ThreadStateException' occurred in mscorlib.dll
Additional information: Thread is suspended; attempting to abort."
Is this a bug?
Luca
-----
[VB.NET]
Dim t As New Thread(New ThreadStart(AddressOf ThreadProc))
t.Start()
t.Suspend()
Thread.Sleep(1000) ' permit to the other thread to run
t.Abort()
Sub ThreadProc()
While True
End While
End Sub
You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.