You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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;
}
The text was updated successfully, but these errors were encountered:
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;
}
The text was updated successfully, but these errors were encountered: