c - (Threads Problems) Full Termination -


i have have problem thread termination ([c] - linux). problem can not finish thread , deallocate resources. because if recall program, see old thread still running

the server code more less this:

int quit=0; void* sending();  main(){ ....... pthread_t thread_send; pthread_create(&thread_send, null, sending, null);  //pthread_join(thread_send); here useful? thread don't finish-  return 0; }   void *sending(){    while(quit==0){        if(...){          quit=1;       }     } //pthread_exit(null); here useful ? return 0; } 

how can use pthred_exit() or pthred_kill(); or pthread_detach or pthread_join? terminate thread , deallocating memory used thread.

thank you!


Comments

Popular posts from this blog

java - WrongTypeOfReturnValue exception thrown when unit testing using mockito -

php - Magento - Deleted Base url key -

android - How to disable Button if EditText is empty ? -