The application registration thread receives new connections from
applications, provides them to the dispatch thread. The dispatch
thread, in turn, forwards the command and notification sockets of
applications (liblttng-ust) to the application management and
application notification threads.
Not shutting down the application registration thread is problematic
since application connections will be accepted but not associated
to an "ust_app" structure as the following threads are no longer
present.
The remaining threads can then be safely torn down as part of the
orphaned threads.
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
struct rotation_thread_timer_queue *rotation_timer_queue = NULL;
struct lttng_thread *client_thread = NULL;
struct lttng_thread *notification_thread = NULL;
+ struct lttng_thread *register_apps_thread = NULL;
init_kernel_workarounds();
}
/* Create thread to manage application registration. */
- if (!launch_application_registration_thread(&ust_cmd_queue)) {
+ register_apps_thread = launch_application_registration_thread(
+ &ust_cmd_queue);
+ if (!register_apps_thread) {
retval = -1;
goto exit_reg_apps;
}
exit_agent_reg:
exit_apps_notify:
exit_apps:
+ if (register_apps_thread) {
+ lttng_thread_shutdown(register_apps_thread);
+ lttng_thread_put(register_apps_thread);
+ }
exit_reg_apps:
exit_dispatch:
exit_client:
return notify_thread_pipe(write_fd) == 1;
}
-bool launch_application_registration_thread(
+struct lttng_thread *launch_application_registration_thread(
struct ust_cmd_queue *cmd_queue)
{
struct lttng_pipe *quit_pipe;
if (!thread) {
goto error;
}
- lttng_thread_put(thread);
- return true;
+ return thread;
error:
cleanup_application_registration_thread(notifiers);
- return false;
+ return NULL;
}
#include <stdbool.h>
#include "lttng-sessiond.h"
-bool launch_application_registration_thread(struct ust_cmd_queue *cmd_queue);
+struct lttng_thread *launch_application_registration_thread(
+ struct ust_cmd_queue *cmd_queue);
#endif /* SESSIOND_APPLICATION_REGISTRATION_THREAD_H */