Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

crash while calling ad_server_stop #36

Open
manjunathkokhle opened this issue Jun 12, 2019 · 1 comment
Open

crash while calling ad_server_stop #36

manjunathkokhle opened this issue Jun 12, 2019 · 1 comment

Comments

@manjunathkokhle
Copy link

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;
}

@wolkykim
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants