mirror of
https://github.com/BepInEx/mono.git
synced 2026-11-15 17:10:51 -10:00
[bcl] Fix a race in a Task test. Fixes #20921.
This commit is contained in:
1 parent
2103f2394e
commit
cd35ca1fe9
2 files changed
+6
-1
No files matched your search
@@ -449,6 +449,7 @@ namespace MonoTests.System.Runtime.CompilerServices {
|
||||
th.Join ();
|
||||
GC.Collect ();
|
||||
GC.Collect ();
|
||||
GC.WaitForPendingFinalizers ();
|
||||
|
||||
Assert.AreEqual (0, reachable, "#1");
|
||||
}
|
||||
|
||||
@@ -904,7 +904,11 @@ namespace MonoTests.System.Threading.Tasks
|
||||
args.SetObserved ();
|
||||
};
|
||||
var inner = new ApplicationException ();
|
||||
Task.Factory.StartNew (() => { throw inner; });
|
||||
Thread t = new Thread (delegate () {
|
||||
Task.Factory.StartNew (() => { Console.WriteLine ("HIT!"); throw inner; });
|
||||
});
|
||||
t.Start ();
|
||||
t.Join ();
|
||||
Thread.Sleep (1000);
|
||||
GC.Collect ();
|
||||
Thread.Sleep (1000);
|
||||
|
||||
Reference in new issue
Block a user