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

@ -13,6 +13,7 @@ using System;
using System.Globalization;
using System.Security.Principal;
using System.Threading;
using System.Threading.Tasks;
using System.Reflection;
using System.Collections.Generic;
using SD = System.Diagnostics;
@ -908,6 +909,23 @@ namespace MonoTests.System.Threading
}
#endif // MONO_FEATURE_MULTIPLE_APPDOMAINS
[Test]
public void SetNameInThreadPoolThread ()
{
Task t = Task.Run (delegate () {
Thread.CurrentThread.Name = "ThreadName1";
Assert.AreEqual (Thread.CurrentThread.Name, "ThreadName1", "#1");
try {
Thread.CurrentThread.Name = "ThreadName2";
Assert.Fail ("#2");
} catch (InvalidOperationException) {
}
});
t.Wait ();
}
void CheckIsRunning (string s, Thread t)
{
int c = counter;