Fredrik,
Not per se.
If you need the ability you should use a WaitHandle, such as AutoResetEvent
or ManualResetEvent.
Then instead of using Threading.Thread.Sleep you would use
Threading.WaitHandle.WaitOne with a timeout value. The other thread can use
*ResetEvent.Set to cause the first thread to wake up. With the timeout on
WaitOne the first thread will automatically wake up if another thread does
not call Set.
Dim event As New AutoResetEvent
Public Sub Tread1()
If event.WaitOne(2000, False) Then
' event.Set was called
Else
' event timed out
End if
End Sub
Public Sub Thread2()
event.Set() ' wake up thread1
End Sub
Hope this helps
Jay
"Fredrik Melin" <me*@n.o.spam.dacsa.net.remove.as.needed> wrote in message
news:b-********************@giganews.com...
If I use Threading.Thread.Sleep is there a way to cancel that sleep from
another thread?
Regards
Fredrik