2 * Copyright (C) 2017 - Julien Desfossez <jdesfossez@efficios.com>
3 * Copyright (C) 2018 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License, version 2 only, as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 51
16 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #ifndef ROTATION_THREAD_H
20 #define ROTATION_THREAD_H
22 #include <urcu/list.h>
24 #include <urcu/rculfhash.h>
25 #include <lttng/domain.h>
26 #include <common/pipe.h>
27 #include <common/compat/poll.h>
28 #include <common/hashtable/hashtable.h>
30 #include <semaphore.h>
32 #include "notification-thread.h"
34 extern struct lttng_notification_channel
*rotate_notification_channel
;
36 enum rotation_thread_job_type
{
37 ROTATION_THREAD_JOB_TYPE_SCHEDULED_ROTATION
,
38 ROTATION_THREAD_JOB_TYPE_CHECK_PENDING_ROTATION
41 struct rotation_thread_timer_queue
;
42 struct rotation_thread_handle
;
44 struct rotation_thread_timer_queue
*rotation_thread_timer_queue_create(void);
45 void rotation_thread_timer_queue_destroy(
46 struct rotation_thread_timer_queue
*queue
);
48 struct rotation_thread_handle
*rotation_thread_handle_create(
49 struct rotation_thread_timer_queue
*rotation_timer_queue
,
50 struct notification_thread_handle
*notification_thread_handle
);
52 void rotation_thread_handle_destroy(
53 struct rotation_thread_handle
*handle
);
55 void rotation_thread_enqueue_job(struct rotation_thread_timer_queue
*queue
,
56 enum rotation_thread_job_type job_type
,
57 struct ltt_session
*session
);
59 bool launch_rotation_thread(struct rotation_thread_handle
*handle
);
61 #endif /* ROTATION_THREAD_H */