I am trying to debug when my threads exit to track the problem. Per this thread , I gave my topic name. However, in the exit message in Visual Studio, it still does not print the stream name, but only the identifier:
Stream 0x1ed4 exited with code 259 (0x103)
Is there a setting or something that I am missing? I searched everywhere for VS, but it seems I haven't found anything.
And maybe I'll just call it wrong, so here is a small example that shows what I'm talking about:
class Program
{
static ManualResetEvent aThreadMre;
static void Main(string[] args)
{
aThreadMre = new ManualResetEvent(false);
Thread aThread = new Thread(Process);
aThread.Name = "a_thread";
aThread.Start();
Thread.Sleep(TimeSpan.FromSeconds(5));
aThreadMre.Set();
aThread.Join();
}
static void Process()
{
Console.WriteLine(Thread.CurrentThread.Name);
int counter = 0;
while (true)
{
if (aThreadMre.WaitOne(TimeSpan.FromSeconds(1)))
{
break;
}
Console.WriteLine(++counter);
}
}
}
source
share