title: Is there a way to get some function called on every thread that gets created?
body: <p>I want some function to be called (so it can do some initialization) in any thread that is started.
  The threads that are started are outside of my control, so I can't modify all code that starts the threads.</p>
  
  <p>In more detail:
  On windows one should install a terminate handler in every thread. (<a href="https://en.cppreference.com/w/cpp/error/set_terminate" rel="nofollow noreferrer">std::set_terminate</a>: <a href="https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/set-terminate-crt?view=vs-2019" rel="nofollow noreferrer">https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/set-terminate-crt?view=vs-2019</a>)
  (yes this deviates from the standard but that's not the point here).
  So basically I want to set my handler in all threads in my application.</p>