Bugzilla – Bug 324396
[PATCH] ThreadState.BackGround bit must be cleared when thread is stopped
Last modified: 2007-09-15 21:24:46 UTC
---- Reported by gert.driesen@pandora.be 2007-05-23 14:51:16 MST ---- When a Thread is stopped, then the ThreadState.BackGround bit is cleared on MS. To reproduce, compile and run the following code snippet: using System; using System.Threading; class Program { static void Start () { } static void Main () { Thread t = new Thread (new ThreadStart (Start)); t.IsBackground = true; Console.WriteLine ("#1: " + t.ThreadState); t.Start (); t.Join (); Console.WriteLine ("#2: " + t.ThreadState); } } Expected result: #1: Background, Unstarted #2: Stopped Actual result: #1: Background, Unstarted #2: Background, Stopped I'll a unit test to ThreadTest.cs to prevent regressions. ---- Additional Comments From gert.driesen@pandora.be 2007-05-23 14:57:06 MST ---- Created an attachment (id=172043) Fix ---- Additional Comments From vargaz@gmail.com 2007-06-07 15:53:17 MST ---- This looks ok to check in. ---- Additional Comments From gert.driesen@pandora.be 2007-06-08 15:12:06 MST ---- Fixed in SVN (revision 78981) and enabled unit test (revision 78982). Imported an attachment (id=172043)