I have a tricky problem, I'm doing some automated UI-Test in C# in a background-thread and now i'm wondering, what's the best way to stop it.
I know that I absolutely shouldn't use Thread.Abort(), but the big problem is i also cannot use a flag, because one testing loop takes about a half hour and it should be stopped instantly.
The only solution to which i have come is to check a flag after every step, which will be about 100 times and will also be to slow, because some steps need some seconds to be done.
Does anyone know another possible solution without using Thread.Abort()?