S
sleepyant
Hi, I have a thread where it will do a Do While..Loop and check the
blnCancel boolean in every loop. If blnCancel is True, then the loop will
exit and the Thread should be terminated naturally. But there is some
scenario where the program stuck somewhere in the Do While..Loop and and
unable to exit the loop. In this case, I would need to abort the thread all
together. But I have some problem in doing this, here is how I did:
Private Sub DoCancel()
blnCancel = True
If th.IsAlive Then
If th.Join(10000) = False Then <------Prolem: Always
return False.
th.Abort()
End If
End If
End Sub
The th.Join (miliseconds) always return false even I know the thread should
have terminated "normally". How can I solve this? Please advice. Thanks.
blnCancel boolean in every loop. If blnCancel is True, then the loop will
exit and the Thread should be terminated naturally. But there is some
scenario where the program stuck somewhere in the Do While..Loop and and
unable to exit the loop. In this case, I would need to abort the thread all
together. But I have some problem in doing this, here is how I did:
Private Sub DoCancel()
blnCancel = True
If th.IsAlive Then
If th.Join(10000) = False Then <------Prolem: Always
return False.
th.Abort()
End If
End If
End Sub
The th.Join (miliseconds) always return false even I know the thread should
have terminated "normally". How can I solve this? Please advice. Thanks.