title: Get index of pthread without passing it as an argument to a function.
body: <p>I was told that I can get the index of a pthread in relation to other pthreads (0,1,2, etc.). </p>
  
  <p>However using both </p>
  
  <pre><code>pthread_t id = pthread_self();
  uint64_t tid;
  
  pthread_threadid_np(NULL, &amp;tid);
  </code></pre>
  
  <p>Gives the following. (for example with 4 pthreads.) </p>
  
  <pre><code>2134955
  2134954
  2134956
  2134957
  
  232833024
  232296448
  233369600
  233906176
  </code></pre>
  
  <p>I am looking to get the index of the pthread (0,1,2,3) in this case. Is that possible without sending it as an argument to the pthread function? Thanks for the help.</p>