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
Post a Comment