title: How to destroy thread in c linux
body: <p>I need a thread that will call continuously in while(1), but when i use to call thread function by pthread_create() a new thread creates.<br>
  I need help on following points :~ <br>
  1) Is there any method to call thread function without creating thread.<br>
  2) Is there any method to destroy the previous thread.<br>
  <br>
  Sample code is <br></p>
  
  <pre><code>void main()
  {
  pthread_t thread1;
   while(1)
   {
          pthread_create( &amp;thread1, NULL, myFun,  (void*) NULL);
   }
  }
  void * myFun(void *ptr)
  {
  printf("Hello");
  }
  </code></pre>
  
  <p><br>
  <strong>*</strong> We can not create more than 380 threads, Here we have to use only single thread.</p>