title: how can I tell if pthread_self is the main (first) thread in the process?
body: <p>background: I'm working on a logging library that is used by many programs.<br>
  I'm assigning a human-readable name for each thread, the main thread should get "main", but I'd like to be able to detect that state from within the library without requiring code at the beginning of each main() function. </p>
  
  <p>Also note: The library code will not always be entered first from the main thread.</p>