Is stopping a thread by acting the "break" command at some point a safe way to stop a thread?
Do you mean doing something like this?
void SomeMethod()
{
while(true)
{
//do something
if(condition)
break;
}
}
//somewhere else...
Thread t = new Thread(SomeMethod);
t.Start();
If so, then yes, it's a safe way to end the thread.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With