Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. internal class MyClass
  2. {
  3. private bool _isDone;
  4. static void Main(string[] args)
  5. {
  6. var instance = new MyClass();
  7. var thread = new Thread(instance.DoWork);
  8. thread.Start();
  9. instance.DoWork();
  10. Console.Read();
  11. }
  12.  
  13. private void DoWork()
  14. {
  15. if (!_isDone)
  16. {
  17. _isDone = true;
  18. Console.WriteLine("Work done");
  19. }
  20. }
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement