/* Queue of rotation jobs populated by the sessiond-timer. */
struct rotation_thread_timer_queue *rotation_timer_queue = NULL;
struct lttng_thread *client_thread = NULL;
+ struct lttng_thread *notification_thread = NULL;
init_kernel_workarounds();
}
/* Create notification thread. */
- if (!launch_notification_thread(notification_thread_handle)) {
+ notification_thread = launch_notification_thread(
+ notification_thread_handle);
+ if (!notification_thread) {
retval = -1;
goto exit_notification;
}
rcu_thread_online();
sessiond_cleanup();
+ if (notification_thread) {
+ lttng_thread_shutdown(notification_thread);
+ lttng_thread_put(notification_thread);
+ }
+
/*
* Ensure all prior call_rcu are done. call_rcu callbacks may push
* hash tables to the ht_cleanup thread. Therefore, we ensure that
return true;
}
-bool launch_notification_thread(struct notification_thread_handle *handle)
+struct lttng_thread *launch_notification_thread(
+ struct notification_thread_handle *handle)
{
struct lttng_thread *thread;
* (e.g. rotation thread).
*/
wait_until_thread_is_ready(handle);
- lttng_thread_put(thread);
- return true;
+ return thread;
error:
- return false;
+ return NULL;
}
#include <common/hashtable/hashtable.h>
#include <pthread.h>
#include <semaphore.h>
+#include "thread.h"
struct notification_thread_handle {
/*
struct lttng_pipe *kernel_channel_monitor_pipe);
void notification_thread_handle_destroy(
struct notification_thread_handle *handle);
-bool launch_notification_thread(struct notification_thread_handle *handle);
+struct lttng_thread *launch_notification_thread(
+ struct notification_thread_handle *handle);
#endif /* NOTIFICATION_THREAD_H */