title: Get call stack from any thread within C
body: <p>In C on Solaris 10, I'd like to get the call stack from an arbitrary thread within a process.</p>
  
  <p>I have many worker threads and one thread which monitors them all to detect tight loops and deadlocks.  The function I'd like to implement is for the monitoring thread to print the call stack from the "hung" thread several times before it kills it.</p>
  
  <p>I know how to implement this by having the monitoring thread execute pstack (with system() or by forking).  But I would like to be able to implement this function in C.  Is there any way to do this?</p>
  
  <p>I know how to make a thread print its OWN call stack, by walking the stack, which is useful if it hits an assert, but not how to do this for another thread within the same process.</p>
  
  <p>Thanks for any help.
  NickB</p>