Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Thread Debug, Want A Name

Still trying to debug 3 different threads.

I can see that the threads are cooperating; sortta; sometimes; but I can't really see which thread is doing what.

The "console" window shows me things like this...

The thread '< No Name >' (0x14a4) has exited with code 0 (0x0).
The thread '< No Name >' (0xec8) has exited with code 0 (0x0).
The thread '< No Name> ' (0x15a8) has exited with code 0 (0x0).

I thought it would be great to put a name with these hex values that don't tell me anything.

I looked on this MSDN page and this other one which were probably accurate, but I missed the part on where you change <No Name> to something like Background Rx or Label1_Text_Change or whatever.

Example...

this.demoThread =
     new Thread(new ThreadStart(this.Antarctica));

this.demoThread.Start();

I hate being the site's leading dunce, but could someone please demonstrate, in this three line example (really it's two lines, but whatever) how do I tell C# and Visual Studio to change <no name> to Antarctica ? I'm talking about watching the sequence in the console window a the bottom of the Visual Studio IDE.

If it matters, the app is displayed on one screen while the Visual Studio IDE is displayed on the other.

like image 852
User.1 Avatar asked May 30 '26 07:05

User.1


1 Answers

this.demoThread.Name = "Antarctica";

Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!