DBG("%s lttng-sessiond has performed an orderly shutdown", sock_info->name);
ust_lock();
if (lttng_ust_comm_should_quit) {
DBG("%s lttng-sessiond has performed an orderly shutdown", sock_info->name);
ust_lock();
if (lttng_ust_comm_should_quit) {
goto quit;
}
/* Cleanup socket handles before trying to reconnect */
lttng_ust_objd_table_owner_cleanup(sock_info);
ust_unlock();
goto restart; /* try to reconnect */
goto quit;
}
/* Cleanup socket handles before trying to reconnect */
lttng_ust_objd_table_owner_cleanup(sock_info);
ust_unlock();
goto restart; /* try to reconnect */
ret = pthread_create(&global_apps.ust_listener, &thread_attr,
ust_listener_thread, &global_apps);
if (ret) {
ERR("pthread_create global: %s", strerror(ret));
}
ret = pthread_create(&global_apps.ust_listener, &thread_attr,
ust_listener_thread, &global_apps);
if (ret) {
ERR("pthread_create global: %s", strerror(ret));
}
ret = pthread_create(&local_apps.ust_listener, &thread_attr,
ust_listener_thread, &local_apps);
if (ret) {
ERR("pthread_create local: %s", strerror(ret));
}
ret = pthread_create(&local_apps.ust_listener, &thread_attr,
ust_listener_thread, &local_apps);
if (ret) {
ERR("pthread_create local: %s", strerror(ret));
}
- ret = pthread_cancel(global_apps.ust_listener);
- if (ret) {
- ERR("Error cancelling global ust listener thread: %s",
- strerror(ret));
+ if (global_apps.thread_active) {
+ ret = pthread_cancel(global_apps.ust_listener);
+ if (ret) {
+ ERR("Error cancelling global ust listener thread: %s",
+ strerror(ret));
+ } else {
+ global_apps.thread_active = 0;
+ }
ret = pthread_cancel(local_apps.ust_listener);
if (ret) {
ERR("Error cancelling local ust listener thread: %s",
strerror(ret));
ret = pthread_cancel(local_apps.ust_listener);
if (ret) {
ERR("Error cancelling local ust listener thread: %s",
strerror(ret));
/*
* Do NOT join threads: use of sys_futex makes it impossible to
* join the threads without using async-cancel, but async-cancel
/*
* Do NOT join threads: use of sys_futex makes it impossible to
* join the threads without using async-cancel, but async-cancel