2010-02-19 Rodrigo Kumpera <rkumpera@novell.com>
[mono.git] / mono / tests / generic-special.2.cs
blobdc66a7a18a3d2eba9cd0c68fbbfc60a663081343
1 using System;
2 using System.Threading;
4 public class IntClass {
5 public int i;
7 public IntClass (int val) { i = val; }
9 public int get () { return i; }
12 public class Gen<T> {
13 [ThreadStaticAttribute]
14 static T field;
16 public static void setField (T t) { field = t; }
17 public static T getField () { return field; }
20 public class main {
21 static int i1;
22 static int i2;
24 public static void otherThread () {
25 Gen<IntClass>.setField (new IntClass (2));
26 i2 = Gen<IntClass>.getField ().get ();
29 public static int Main () {
30 Gen<IntClass>.setField (new IntClass (1));
32 Thread thread = new Thread (main.otherThread);
33 thread.Start ();
34 thread.Join ();
36 i1 = Gen<IntClass>.getField ().get ();
38 if (i1 != 1 || i2 != 2)
39 return 1;
40 return 0;