title: pthread_join function in c
body: <p>I have problem with pthread_join(), hope everyone answer.
  I am running the program below, and have one row to be printed out. After that, I am trying to delete "pthread_join(th,&amp;val), and no row to be printed out. </p>
  
  <p>I found out all function in program, but i don't understand why.</p>
  
  <p>Can you help me, I am appreciated all answers.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;pthread.h&gt;
  
  #define SMALL_STACK 131072
  
  pthread_attr_t thread_attr;
  void* fn(void* arg);
  int main(int argc, char** argv)
  {
      pthread_attr_init(&amp;thread_attr);
      pthread_attr_setstacksize(&amp;thread_attr, SMALL_STACK);
  
      pthread_t th;
  
      pthread_create(&amp;th, &amp;thread_attr, fn, (void*)14);
      void* val;
      pthread_join(th, &amp;val);
  
      return 0;
  }
  
  void* fn(void* arg)
  {
      printf("arg = 0x%x\n", (int)arg);
      return NULL;
  }
  </code></pre>