libasyncd icon indicating copy to clipboard operation
libasyncd copied to clipboard

crash while calling ad_server_stop

Open manjunathkokhle opened this issue 6 years ago • 1 comments

Hi, i have started 6 server threads which are running independantly, and there is a need for me to stop them at some instance of execution. while i was invoking the function ad_server_stop(server*) the code was getting stuck at : pthread_join function. "Waiting server's last loop to finish"

But after modifying the code like below it started working. if (server->thread) { void *retval = NULL; DEBUG("Waiting server's last loop to finish."); pthread_join((server->thread), &retval); //// earlier the argument to this function was (*pthread_t) which is wrong , it should be just pthread_t. free(retval); free(server->thread); server->thread = NULL; }

manjunathkokhle avatar Jun 12 '19 10:06 manjunathkokhle

Nice catch. Can you please send a PR for this fix?

wolkykim avatar Jun 12 '19 11:06 wolkykim