Allow setting the name of threadpool threads. Fixes #4269.
[mono.git] / mcs / class / corlib / Test / System.Threading / ThreadTest.cs
index 58cdf99446e8f702894c61a0d5f5c194c4931bb5..0603d278b71fde56798d87045a3dcb4e6cf928b0 100644 (file)
@@ -1125,6 +1125,15 @@ namespace MonoTests.System.Threading
                        Thread.VolatileWrite (ref v4, float.MaxValue);
                        Assert.AreEqual (v4, float.MaxValue);
                }
+
+               [Test]
+               public void SetNameTpThread () {
+                       ThreadPool.QueueUserWorkItem(new WaitCallback(ThreadProc));
+               }
+
+               static void ThreadProc(Object stateInfo) {
+                       Thread.CurrentThread.Name = "My Worker";
+               }
        }
 
        public class TestUtil