fork download
  1. using System;
  2.  
  3. namespace System.Threading
  4. {
  5. static class Monitor
  6. {
  7. public static void Enter(object obj, ref bool locked)
  8. {
  9. locked = true;
  10. Console.WriteLine("Enter");
  11. }
  12. public static void Exit(object obj)
  13. {
  14. Console.WriteLine("Exit");
  15. }
  16. }
  17. }
  18.  
  19. namespace MonitorEnterTest
  20. {
  21. class Program
  22. {
  23. static void Main(string[] args)
  24. {
  25. var syncRoot = new object();
  26. lock (syncRoot)
  27. {
  28.  
  29. }
  30.  
  31. Console.WriteLine("Press any key!!!");
  32. Console.ReadKey();
  33. }
  34. }
  35. }
  36.  
Success #stdin #stdout 0s 29664KB
stdin
Standard input is empty
stdout
Press any key!!!