Babeltrace 2 C API  2.1.0
Open-source trace manipulation framework
interrupter.h
1 /*
2  * SPDX-License-Identifier: MIT
3  *
4  * Copyright (C) 2010-2019 EfficiOS Inc. and Linux Foundation
5  */
6 
7 #ifndef BABELTRACE2_GRAPH_INTERRUPTER_H
8 #define BABELTRACE2_GRAPH_INTERRUPTER_H
9 
10 /* IWYU pragma: private, include <babeltrace2/babeltrace.h> */
11 
12 #ifndef __BT_IN_BABELTRACE_H
13 # error "Please include <babeltrace2/babeltrace.h> instead."
14 #endif
15 
16 #include <babeltrace2/types.h>
17 
18 #ifdef __cplusplus
19 extern "C" {
20 #endif
21 
111 extern bt_interrupter *bt_interrupter_create(void) __BT_NOEXCEPT;
112 
137 extern void bt_interrupter_set(bt_interrupter *interrupter) __BT_NOEXCEPT;
138 
156 extern void bt_interrupter_reset(bt_interrupter *interrupter) __BT_NOEXCEPT;
157 
175 extern bt_bool bt_interrupter_is_set(const bt_interrupter *interrupter)
176  __BT_NOEXCEPT;
177 
200 extern void bt_interrupter_get_ref(const bt_interrupter *interrupter)
201  __BT_NOEXCEPT;
202 
218 extern void bt_interrupter_put_ref(const bt_interrupter *interrupter)
219  __BT_NOEXCEPT;
220 
235 #define BT_INTERRUPTER_PUT_REF_AND_RESET(_interrupter) \
236  do { \
237  bt_interrupter_put_ref(_interrupter); \
238  (_interrupter) = NULL; \
239  } while (0)
240 
266 #define BT_INTERRUPTER_MOVE_REF(_dst, _src) \
267  do { \
268  bt_interrupter_put_ref(_dst); \
269  (_dst) = (_src); \
270  (_src) = NULL; \
271  } while (0)
272 
277 #ifdef __cplusplus
278 }
279 #endif
280 
281 #endif /* BABELTRACE2_GRAPH_INTERRUPTER_H */
bt_interrupter * bt_interrupter_create(void)
Creates a default interrupter.
void bt_interrupter_put_ref(const bt_interrupter *interrupter)
Decrements the reference count of the interrupter interrupter.
struct bt_interrupter bt_interrupter
Interrupter.
Definition: types.h:57
int bt_bool
Babeltrace 2 boolean type.
Definition: types.h:126
bt_bool bt_interrupter_is_set(const bt_interrupter *interrupter)
Returns whether or not the interrupter interrupter is set.
void bt_interrupter_get_ref(const bt_interrupter *interrupter)
Increments the reference count of the interrupter interrupter.
void bt_interrupter_reset(bt_interrupter *interrupter)
Resets the interrupter interrupter.
void bt_interrupter_set(bt_interrupter *interrupter)
Sets the interrupter interrupter.