2 * SPDX-License-Identifier: MIT
4 * Copyright (c) 2019 Philippe Proulx <pproulx@efficios.com>
7 #define BT_LOG_TAG "LIB/INTERRUPTER"
8 #include "lib/logging.h"
12 #include <babeltrace2/babeltrace.h>
14 #include "interrupter.h"
15 #include "lib/assert-cond.h"
18 void destroy_interrupter(struct bt_object
*obj
)
23 extern struct bt_interrupter
*bt_interrupter_create(void)
25 struct bt_interrupter
*intr
= g_new0(struct bt_interrupter
, 1);
27 BT_ASSERT_PRE_NO_ERROR();
30 BT_LIB_LOGE_APPEND_CAUSE("Failed to allocate one interrupter.");
34 bt_object_init_shared(&intr
->base
, destroy_interrupter
);
38 BT_OBJECT_PUT_REF_AND_RESET(intr
);
44 void bt_interrupter_set(struct bt_interrupter
*intr
)
46 BT_ASSERT_PRE_NON_NULL(intr
, "Interrupter");
50 void bt_interrupter_reset(struct bt_interrupter
*intr
)
52 BT_ASSERT_PRE_NON_NULL(intr
, "Interrupter");
56 bt_bool
bt_interrupter_is_set(const struct bt_interrupter
*intr
)
58 BT_ASSERT_PRE_NON_NULL(intr
, "Interrupter");
59 return (bt_bool
) intr
->is_set
;
62 void bt_interrupter_get_ref(const struct bt_interrupter
*intr
)
64 bt_object_get_ref(intr
);
67 void bt_interrupter_put_ref(const struct bt_interrupter
*intr
)
69 bt_object_put_ref(intr
);
This page took 0.036481 seconds and 4 git commands to generate.