Пример #1
0
    public static void Main()
    {
        StaticLocks a = new StaticLocks();

        a.RunTest();
        a.RunTest();
        a.RunTest();

        Console.WriteLine("Forcing contention");
        a.ForceContention();
        Console.WriteLine("Contention forced");

        a.RunTest();
        a.RunTest();
        a.RunTest();
    }
Пример #2
0
   public static void Main() {
      
      StaticLocks a = new StaticLocks();

      a.RunTest();
      a.RunTest();
      a.RunTest();

      Console.WriteLine("Forcing contention");
      a.ForceContention();
      Console.WriteLine("Contention forced");

      a.RunTest();
      a.RunTest();
      a.RunTest();
   }
Пример #3
0
 static void Foo(StaticLocks a)
 {
     Thread.Sleep(1);
 }
Пример #4
0
 static void Bar(StaticLocks a)
 {
     a.counter++;
 }
Пример #5
0
 static void Foo(StaticLocks a)
 {
     Thread.Sleep(1);
 }
Пример #6
0
 static void Bar(StaticLocks a)
 {
     a.counter++;
 }