title: id of "main" thread in c++
body: <p>Is there a way in c++ to get the id of the "main" program thread?</p>
  
  <p>I see that <code>std::this_thread::get_id()</code> gets the id of the currently executing thread but I need the id of the <code>main</code>, original program thread. I don't see any function to get this.</p>
  
  <p>The reason is that I have some non thread safe internal functions that must only be called on the original thread of the application so to be safe I want to do :-</p>
  
  <pre><code>assert(std::this_thread::get_id() == std::main_thread::get_id());
  </code></pre>
  
  <p>But there of course isn't a function to do that, and I can't see any way to get that information.</p>