title: Why does pthread_exit(0) hangs the program?
body: <p>Running the following C code causes the program to hang, and does not respond to signals (including CTRL-C).</p>
  
  <pre><code>int main()
  {
      pthread_exit(0);
      return 0;
  }
  </code></pre>
  
  <p>Any idea why?</p>
  
  <p>The behaviour is normal when other threads have been created and are running, but I would like to know if I always have to check that before using pthread_exit(0).</p>
  
  <p>EDIT:
  This is the complete code that hangs. However, I was building with glib (-lglib-2.0). Using simply cc -o foo foo.c works as expected.</p>