https://bugzilla.novell.com/show_bug.cgi?id=335579
Summary: All threads from the pool have the same value for
Thread.ManagedThreadId
Product: Mono: Class Libraries
Version: unspecified
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: P5 - None
Component: Sys.Core
AssignedTo: [EMAIL PROTECTED]
ReportedBy: [EMAIL PROTECTED]
QAContact: [EMAIL PROTECTED]
Found By: ---
ThreadPool threads don't initialize its ManagedThreadId value, so it always
returns 0.
Test case:
using System;
using System.Threading;
public class Bla
{
public static void Main ()
{
Console.WriteLine ("id1:" +
Thread.CurrentThread.ManagedThreadId);
System.Threading.ThreadPool.QueueUserWorkItem (AnotherThread);
System.Threading.ThreadPool.QueueUserWorkItem (AnotherThread);
System.Threading.ThreadPool.QueueUserWorkItem (AnotherThread);
Thread.Sleep (100);
}
static void AnotherThread (object o)
{
Console.WriteLine ("id2:" +
Thread.CurrentThread.ManagedThreadId);
}
}
It prints:
id1:0
id2:0
id2:0
id2:0
It should print:
id1:0
id2:1
id2:2
id2:3
--
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
_______________________________________________
mono-bugs maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs