code_junkie

.Net Threading Problem

Nov 12th, 2011
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. ThreadStart threadStart = controller.OpenFile;
  2. Thread thread = new Thread(threadStart);
  3. thread.Start();
  4.  
  5. System.Console.Error.WriteLine("Launching");
  6.  
  7. using System;
  8. using System.Threading;
  9.  
  10. namespace Net_Threading_Problem
  11. {
  12. class Program
  13. {
  14. static void Main()
  15. {
  16. Controller controller = new Controller();
  17. ThreadStart threadStart = controller.OpenFile;
  18. Thread thread = new Thread(threadStart);
  19. thread.Start();
  20.  
  21. thread.Join();
  22. }
  23. }
  24.  
  25. internal class Controller
  26. {
  27. public void OpenFile()
  28. {
  29. Console.Error.WriteLine("Launching");
  30. }
  31. }
  32. }
Add Comment
Please, Sign In to add comment