2 * Copyright (C) 2017 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License, version 2 only, as
6 * published by the Free Software Foundation.
8 * This program is distributed in the hope that it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc., 51
15 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 #ifndef NOTIFICATION_THREAD_H
19 #define NOTIFICATION_THREAD_H
21 #include <urcu/wfcqueue.h>
22 #include <lttng/trigger/trigger.h>
25 enum notification_command_type
{
26 NOTIFICATION_COMMAND_TYPE_NEW_TRIGGER
,
29 struct notification_command
{
30 /* Futex on which to wait for command reply. */
32 enum lttng_error_code result
;
33 enum notification_command_type type
;
36 struct notification_new_trigger_command
{
37 struct notification_command parent
;
38 /* Set to NULL if ownership was transfered. */
39 struct lttng_trigger
*trigger
;
42 /* Data passed to the thread on initialization. */
43 struct notification_thread_data
{
45 * Queue of struct notification command.
46 * event_fd must be WRITE(2) to signal that a new command
49 struct notification_cmd_queue
{
51 struct cds_list_head list
;
56 struct notification_command
*notification_new_trigger_command_create(
57 struct lttng_trigger
*trigger
);
58 struct notification_command
*notification_new_trigger_command_destroy(
59 struct lttng_trigger
*trigger
);
61 void *thread_notification(void *data
);
63 struct notification_thread_data
*notification_init_data(void);
64 void notification_destroy_data(struct notification_thread_data
*data
);
66 #endif /* NOTIFICATION_THREAD_H */