title: How to debug only one thread in Visual Studio
body: <p>I would like to be able to follow only one thread's execution while debugging. I use a threadpool so the debugger keeps switching between threads and this makes debugging very uncomfortable.</p>
  
  <p>Reading:</p>
  
  <ul>
  <li><em><a href="https://stackoverflow.com/questions/3901736">Visual Studio, debug one of multiple threads</a></em></li>
  <li><em><a href="https://stackoverflow.com/questions/5304752">How to debug a single thread in Visual Studio?</a></em></li>
  </ul>
  
  <p>I get one solution which is conditional breakpoints (based on the name of the thread). However, I can't tell "the thread #3" will always be the one treating the interesting case, so I would have to change the condition for each execution. Too much work.</p>
  
  <p>Another solution is to use the freeze/thaw feature to make only my interesting thread run. However, this make some information unavailable because all threads are paused.</p>
  
  <p>What I am using now is to put make the program run until I get to a breakpoint where I am sure to be in the good thread. Then I pause all other threads of threadpool and try to resume the execution. If the programs seems to be stuck, I pause, and thaw the current thread.</p>
  
  <p>The ideal solution would to find the correct thread, flag it and then say to Visual Studio: "<strong>break only if the current thread is flagged</strong>".</p>
  
  <p>Is this even possible ?</p>