2010-06-18 Rodrigo Kumpera <rkumpera@novell.com>
authorRodrigo Kumpera <kumpera@gmail.com>
Fri, 18 Jun 2010 22:18:56 +0000 (22:18 -0000)
committerRodrigo Kumpera <kumpera@gmail.com>
Fri, 18 Jun 2010 22:18:56 +0000 (22:18 -0000)
* ConditionalWeakTableTest.cs: Fix another test.

svn path=/trunk/mcs/; revision=159159

mcs/class/corlib/Test/System.Runtime.CompilerServices/ChangeLog
mcs/class/corlib/Test/System.Runtime.CompilerServices/ConditionalWeakTableTest.cs

index 01a312e941da219ebaa100e44c17750ae7cc091f..8cb8405bab60fbfbb08c1433076af6889d754aee 100644 (file)
@@ -1,3 +1,7 @@
+2010-06-18 Rodrigo Kumpera  <rkumpera@novell.com>
+
+       * ConditionalWeakTableTest.cs: Fix another test.
+
 2010-06-18 Rodrigo Kumpera  <rkumpera@novell.com>
 
        * ConditionalWeakTableTest.cs: Fix it.
index d227407692cb2faeef63bddb4d07811b80ee128d..4f3b7a73276770f5534224a394db080cbf456cd7 100644 (file)
@@ -276,17 +276,22 @@ namespace MonoTests.System.Runtime.CompilerServices {
        [Test]
        public void OldGenStress () {
                var cwt = new ConditionalWeakTable <object,object>[1];
+               List<object> k = null;
+               List<WeakReference> res, res2;
+               res = res2 = null;
 
-               var res = FillWithNetwork2 (cwt);
+               ThreadStart dele = () => {
+                       res = FillWithNetwork2 (cwt);
+                       ForcePromotion ();
+                       k = FillReachable (cwt);
+                       res2 = FillWithNetwork2 (cwt);
+               };
 
-               ForcePromotion ();
-
-               var k = FillReachable (cwt);
-
-               var res2 = FillWithNetwork2 (cwt);
+               var th = new Thread(dele);
+               th.Start ();
+               th.Join ();
 
                GC.Collect ();
-               //GC.WaitForPendingFinalizers ();
 
                for (int i = 0; i < res.Count; ++i)
                        Assert.IsFalse (res [i].IsAlive, "#r0-" + i);