예제 #1
0
 public void Foo2()
 {
     //Test for thread safety
     RealModel m = new RealModel();
     IModel rm = new DecoratorModel(m);
     Task.Run(new Action(() => rm.Foo1()));
     Task.Run(new Action(() => rm.Foo1()));
     Task.Run(new Action(() => rm.Foo1()));
     Task.Run(new Action(() => rm.Foo1()));
 }
예제 #2
0
 public void Foo1()
 {
     RealModel m = new RealModel();
     IModel rm = new DecoratorModel(m);
     rm.Foo1();
 }