diff options
author | José Bollo <jose.bollo@iot.bzh> | 2018-02-06 16:19:17 +0100 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2018-02-06 16:20:49 +0100 |
commit | 098d6d3c8fb0aff78528746115d0f481da76e5fb (patch) | |
tree | 692a17d8f7a706cc7257bfe54aa4d4623cee0fc6 | |
parent | 4c7b7d3adcc10fbcf64d790a4e7c194ff3d5c6de (diff) |
jobs: Add argument to start
Change-Id: I89a75a036c60097fb898ab8723007ca6ebfc7f39
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r-- | src/jobs.c | 4 | ||||
-rw-r--r-- | src/jobs.h | 7 | ||||
-rw-r--r-- | src/main.c | 4 |
3 files changed, 10 insertions, 5 deletions
@@ -732,7 +732,7 @@ struct sd_event *jobs_get_sd_event() * @param start The start routine to activate (can't be NULL) * @return 0 in case of success or -1 in case of error. */ -int jobs_start(int allowed_count, int start_count, int waiter_count, void (*start)(int signum)) +int jobs_start(int allowed_count, int start_count, int waiter_count, void (*start)(int signum, void* arg), void *arg) { int rc, launched; struct thread me; @@ -782,7 +782,7 @@ int jobs_start(int allowed_count, int start_count, int waiter_count, void (*star } /* queue the start job */ - job = job_create(NULL, 0, (job_cb_t)start, NULL); + job = job_create(NULL, 0, start, arg); if (!job) { ERROR("out of memory"); errno = ENOMEM; @@ -44,5 +44,10 @@ extern struct sd_event *jobs_get_sd_event(); extern void jobs_terminate(); -extern int jobs_start(int allowed_count, int start_count, int waiter_count, void (*start)(int signum)); +extern int jobs_start( + int allowed_count, + int start_count, + int waiter_count, + void (*start)(int signum, void* arg), + void *arg); @@ -535,7 +535,7 @@ static void run_startup_calls() | job for starting the daemon +--------------------------------------------------------- */ -static void start(int signum) +static void start(int signum, void *arg) { struct afb_hsrv *hsrv; @@ -674,7 +674,7 @@ int main(int argc, char *argv[]) afb_debug("main-start"); /* enter job processing */ - jobs_start(3, 0, 50, start); + jobs_start(3, 0, 50, start, NULL); WARNING("hoops returned from jobs_enter! [report bug]"); return 1; } |