[Mono-bugs] [Bug 437888] New: Wrong behavior when changing the background state of a threadpool thread

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Wed Oct 22 15:17:23 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=437888


           Summary: Wrong behavior when changing the background state of a
                    threadpool thread
           Product: Mono: Runtime
           Version: SVN
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: misc
        AssignedTo: gonzalo at novell.com
        ReportedBy: gonzalo at novell.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Compile and run the following program:
----------------------------
using System;
using System.Threading;

class Test {
        static void Main ()
        {
                ThreadPool.QueueUserWorkItem (Proc);
                Thread.Sleep (1000);
                Console.WriteLine ("Wake up Main");
        }

        static void Proc (object unused)
        {
                Console.WriteLine (Thread.CurrentThread.IsBackground);
                Thread.CurrentThread.IsBackground = false;
                Console.WriteLine (Thread.CurrentThread.IsBackground);
                Thread.Sleep (10000);
                Console.WriteLine ("Wake up TP");
        }

}
------------------------------
Expected results:
Wake up Main [after 1 second]
Wake up TP [after 10 seconds]
[exit immediately]

Actual results:
Wake up Main [after 1 second]
Wake up TP [after 10 seconds]
[takes a while to exit]


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the mono-bugs mailing list