lib: add interrupter API
This patch adds an interrupter API to the library.
An interrupter is a very simple shared object which you can set and
reset. On the const side, you can get whether or not the interrupter is
set.
The goal of this object is to be used as an async-signal-safe way to
interrupt a graph or a query executor. An interrupter object can
eventually be shared by many message iterators, interrupting all of them
at once when setting the interrupter. Moreover, a single message
iterator can have many interrupters, making it possible to interrupt one
or more specific message iterators from different interruption sources
(signal, graphical user interface input, thread-specific, etc.).
The user code is still responsible for checking the message iterator's
or sink component's interrupter's state at regular interval when
performing "long" operations.
You can create an interrupter object with bt_interrupter_create(). The
interrupter object is not set at creation time. You can set it with
bt_interrupter_set() and reset it with bt_interrupter_reset().
You can get whether or not the interrupter is set with
bt_interrupter_is_set().
This patch only adds the API: interrupter objects are not used anywhere
yet.
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I610d48b70412d752b34b8d5760adf99a68d20704
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1733
This page took 0.026956 seconds and 4 git commands to generate.