title: How to be notified when a thread has been terminated for some error
body: <p>I am working on a program with a fixed number of threads in C using posix threads.</p>
  
  <p>How can i be notified when a thread has been terminated due to some error?</p>
  
  <p>Is there a signal to detect it?</p>
  
  <p>If so, can the signal handler create a new thread to keep the number of threads the same?</p>