Imported Upstream version 5.0.0.42

Former-commit-id: fd56571888259555122d8a0f58c68838229cea2b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2017-04-10 11:41:01 +00:00
parent 1190d13a04
commit 6bdd276d05
19939 changed files with 3099680 additions and 93811 deletions

View File

@ -20,6 +20,7 @@ namespace MonoTests.System.Threading
{
public int id;
public Mutex mut;
public bool abandoned_exception;
public ConcClass(int id,Mutex mut)
{
this.id = id;
@ -63,7 +64,12 @@ namespace MonoTests.System.Threading
public void WaitAndForget()
{
this.Wait();
try {
this.Wait();
} catch (AbandonedMutexException) {
this.abandoned_exception = true;
}
this.marker = id;
}
public void WaitAndWait()
@ -137,7 +143,7 @@ namespace MonoTests.System.Threading
}
[Test]
public void TestWaitAndFoget1()
public void TestWaitAndForget1()
{
Mutex Sem = new Mutex(false);
ConcClassLoop class1 = new ConcClassLoop(1,Sem);
@ -148,9 +154,11 @@ namespace MonoTests.System.Threading
try {
thread1.Start();
TestUtil.WaitForNotAlive (thread1, "t1");
Assert.IsFalse (class1.abandoned_exception, "e1");
thread2.Start();
TestUtil.WaitForNotAlive (thread2, "t2");
Assert.IsTrue (class2.abandoned_exception, "e2");
Assert.AreEqual (class2.id, class2.marker);
} finally {