code_junkie

To CurrentThread.Abort or not to CurrentThread.Abort

Nov 12th, 2011
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. private void ThreadProc()
  2. {
  3. while (serviceStarted)
  4. {
  5. // do some work
  6.  
  7. Thread.Sleep(new TimeSpan(0, 0, 5));
  8. }
  9.  
  10. Thread.CurrentThread.Abort();
  11. }
Add Comment
Please, Sign In to add comment