- Try to fix the msvc build.
[mono/afaerber.git] / mono / tests / context-static.cs
blob4d8d7a5d68c2c16ef202880836ddccbc648850a4
1 using System;
2 using System.Runtime.Remoting.Contexts;
4 [Synchronization (SynchronizationAttribute.REQUIRES_NEW)]
5 class CBO: ContextBoundObject
7 public bool Test () {
8 Console.WriteLine ("start value: {0}", T.var);
9 if (T.var != 0) return true;
10 T.var = 100;
11 Console.WriteLine ("end value: {0}", T.var);
12 return (T.var != 100);
16 class T {
17 [ContextStatic]
18 public static int var = 5;
20 static int Main () {
21 bool failed = false;
22 var = 10;
24 CBO cbo = new CBO();
25 failed = cbo.Test ();
27 if (var != 10)
28 failed = true;
30 Console.WriteLine ("value in main context: {0}", var);
32 if (failed)
33 return 1;
34 return 0;