How to do it...

  1. Start debugging your multithreaded application after adding a break point somewhere in the code. You can access various debugging windows by going to Debug | Windows in Visual Studio:
  1. The first window available to you is the Threads window. Access it by going to Debug | Windows in Visual Studio or type Ctrl + D, T. In here, you can right-click on a thread to watch and flag it. If you have given your threads names, you will see those names appear in the Name column. To give your thread a name, modify the LockThreadExample() method created in an earlier recipe.
        public void LockThreadExample()        { Task thread1 = Task.Factory.StartNew(() ...

Get C# 7 and .NET Core Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.