From 124de0785901f1182bb55b34c03c6370bd511043 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Andr=C3=A9=20Tanner?= Date: Sat, 6 May 2017 22:58:09 +0200 Subject: vis: add vis_interrupt{,requested} functions --- vis.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'vis.h') diff --git a/vis.h b/vis.h index 60cbb12..a73753e 100644 --- a/vis.h +++ b/vis.h @@ -152,6 +152,18 @@ void vis_resume(Vis*); * @endrst */ bool vis_signal_handler(Vis*, int signum, const siginfo_t *siginfo, const void *context); +/** + * Interrupt long running operation. + * @rst + * .. warning:: There is no guarantee that a long running operation is actually + * interrupted. It is analogous to cooperative multitasking where + * the operation has to voluntarily yield control. + * .. note:: It is invoked from `vis_signal_handler` when receiving ``SIGINT``. + * @endrst + */ +void vis_interrupt(Vis*); +/** Check whether interruption was requested. */ +bool vis_interrupt_requested(Vis*); /** * @} * @defgroup vis_draw -- cgit v1.2.3