Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- internal class MyClass
- {
- private bool _isDone;
- static void Main(string[] args)
- {
- var instance = new MyClass();
- var thread = new Thread(instance.DoWork);
- thread.Start();
- instance.DoWork();
- Console.Read();
- }
- private void DoWork()
- {
- if (!_isDone)
- {
- _isDone = true;
- Console.WriteLine("Work done");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement