summaryrefslogtreecommitdiffstats
path: root/src/jobs.h
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-04-06 10:31:09 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2017-04-06 10:31:28 +0200
commitc186dfbdbd43f5b51a67812ad48e1df1eacf131e (patch)
tree595464a4028f6d548260323120efa0c233adb12c /src/jobs.h
parent9fe2dfd3c4df334607083f989346090e1051a565 (diff)
Add an easy function for synchronous calls
The added function, 'jobs_call', allows to call a job with 'group' sequencing and 'timeout' handling synchronously. The difference with 'jobs_enter' is that the function 'jobs_call' assert that the job is terminated when 'callback' returns. Change-Id: I8c01d1cd017787ca0448b03a899305a9069ebb6c Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/jobs.h')
-rw-r--r--src/jobs.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/jobs.h b/src/jobs.h
index f508e3c0..a98b27ad 100644
--- a/src/jobs.h
+++ b/src/jobs.h
@@ -54,6 +54,12 @@ extern int jobs_enter(
extern int jobs_leave(struct jobloop *jobloop);
+extern int jobs_call(
+ void *group,
+ int timeout,
+ void (*callback)(int, void*),
+ void *arg);
+
extern struct sd_event *jobs_get_sd_event();
extern void jobs_terminate();