2 * Copyright (C) 2017 Julien Desfossez <jdesfossez@efficios.com>
3 * Copyright (C) 2018 Jérémie Galarneau <jeremie.galarneau@efficios.com>
5 * SPDX-License-Identifier: GPL-2.0-only
9 #ifndef ROTATION_THREAD_H
10 #define ROTATION_THREAD_H
12 #include <urcu/list.h>
14 #include <urcu/rculfhash.h>
15 #include <lttng/domain.h>
16 #include <common/pipe.h>
17 #include <common/compat/poll.h>
18 #include <common/hashtable/hashtable.h>
20 #include <semaphore.h>
22 #include "notification-thread.h"
24 extern struct lttng_notification_channel
*rotate_notification_channel
;
26 enum rotation_thread_job_type
{
27 ROTATION_THREAD_JOB_TYPE_SCHEDULED_ROTATION
,
28 ROTATION_THREAD_JOB_TYPE_CHECK_PENDING_ROTATION
31 struct rotation_thread_timer_queue
;
32 struct rotation_thread_handle
;
34 struct rotation_thread_timer_queue
*rotation_thread_timer_queue_create(void);
35 void rotation_thread_timer_queue_destroy(
36 struct rotation_thread_timer_queue
*queue
);
38 struct rotation_thread_handle
*rotation_thread_handle_create(
39 struct rotation_thread_timer_queue
*rotation_timer_queue
,
40 struct notification_thread_handle
*notification_thread_handle
);
42 void rotation_thread_handle_destroy(
43 struct rotation_thread_handle
*handle
);
45 void rotation_thread_enqueue_job(struct rotation_thread_timer_queue
*queue
,
46 enum rotation_thread_job_type job_type
,
47 struct ltt_session
*session
);
49 bool launch_rotation_thread(struct rotation_thread_handle
*handle
);
51 #endif /* ROTATION_THREAD_H */