fork download
  1. using System;
  2. using System.IO;
  3. class Synch {
  4. public void m1() {
  5. lock(this) {
  6. Console.WriteLine("Done");
  7. }
  8. }
  9.  
  10. public void m2() {
  11. lock(this) {
  12. m1();
  13. }
  14. }
  15.  
  16. public static void Main(String[] args) {
  17. Synch s = new Synch();
  18. s.m2();
  19. }
  20. }
Success #stdin #stdout 0.02s 22244KB
stdin
Standard input is empty
stdout
Done