lib: graph API: remove "listener removed" callback parameters
[babeltrace.git] / src / lib / graph / interrupter.h
index 46fd153ba68661da2b2d706009e938e278103ef8..94a890615e8b624329dbcbb9bffe0e91cc67a485 100644 (file)
@@ -23,6 +23,8 @@
  * SOFTWARE.
  */
 
+#include <stdbool.h>
+
 #include <glib.h>
 #include <babeltrace2/babeltrace.h>
 
@@ -33,4 +35,25 @@ struct bt_interrupter {
        bool is_set;
 };
 
+static inline
+bool bt_interrupter_array_any_is_set(const GPtrArray *interrupters)
+{
+       bool is_set = false;
+       uint64_t i;
+
+       BT_ASSERT_DBG(interrupters);
+
+       for (i = 0; i < interrupters->len; i++) {
+               const struct bt_interrupter *intr = interrupters->pdata[i];
+
+               if (intr->is_set) {
+                       is_set = true;
+                       goto end;
+               }
+       }
+
+end:
+       return is_set;
+}
+
 #endif /* BABELTRACE_GRAPH_INTERRUPTER_INTERNAL_H */
This page took 0.023912 seconds and 4 git commands to generate.