Bug 324396 (MONO81720) - [PATCH] ThreadState.BackGround bit must be cleared when thread is stopped
Summary: [PATCH] ThreadState.BackGround bit must be cleared when thread is stopped
Status: RESOLVED FIXED
Alias: MONO81720
Product: Mono: Runtime
Classification: Mono
Component: misc (show other bugs)
Version: 1.2
Hardware: Other All
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Mono Bugs
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-05-23 21:51 UTC by Gert Driesen
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Fix (791 bytes, text/plain)
2007-05-23 21:57 UTC, Thomas Wiest
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 20:39:42 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)