diff options
author | José Bollo <jose.bollo@iot.bzh> | 2017-09-19 14:39:03 +0200 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2017-10-09 14:08:29 +0200 |
commit | 766876ed2e18e7ab281871b890e4a2003006ad20 (patch) | |
tree | 0379e638546415c6609deb86ff834b23c636914f | |
parent | 814561d06929f3adbeb3fbedc0da2fa71074fb35 (diff) |
jobs: add const qualifier for groups
Change-Id: I34faa8e5da4321da53beb323559399d1460562c1
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r-- | src/jobs.c | 16 | ||||
-rw-r--r-- | src/jobs.h | 6 |
2 files changed, 11 insertions, 11 deletions
@@ -50,7 +50,7 @@ typedef void (*job_cb_t)(int, void*); struct job { struct job *next; /**< link to the next job enqueued */ - void *group; /**< group of the request */ + const void *group; /**< group of the request */ job_cb_t callback; /**< processing callback */ void *arg; /**< argument */ int timeout; /**< timeout in second for processing the request */ @@ -125,7 +125,7 @@ static struct job *free_jobs; * @return the created job unblock or NULL when no more memory */ static struct job *job_create( - void *group, + const void *group, int timeout, job_cb_t callback, void *arg) @@ -164,7 +164,7 @@ end: */ static void job_add(struct job *job) { - void *group; + const void *group; struct job *ijob, **pjob; /* prepare to add */ @@ -218,7 +218,7 @@ static inline struct events *events_get() static inline void job_release(struct job *job) { struct job *ijob, **pjob; - void *group; + const void *group; /* first unqueue the job */ pjob = &first_job; @@ -433,7 +433,7 @@ static int start_one_thread() * @return 0 in case of success or -1 in case of error */ int jobs_queue( - void *group, + const void *group, int timeout, void (*callback)(int, void*), void *arg) @@ -515,7 +515,7 @@ static void call_cb(int signum, void *closure) * @see jobs_call, jobs_enter, jobs_leave */ static int do_sync( - void *group, + const void *group, int timeout, void (*sync_cb)(int signum, void *closure), struct sync *sync @@ -559,7 +559,7 @@ static int do_sync( * @return 0 on success or -1 in case of error */ int jobs_enter( - void *group, + const void *group, int timeout, void (*callback)(int signum, void *closure, struct jobloop *jobloop), void *closure @@ -611,7 +611,7 @@ int jobs_leave(struct jobloop *jobloop) * @return 0 in case of success or -1 in case of error */ int jobs_call( - void *group, + const void *group, int timeout, void (*callback)(int, void*), void *arg) @@ -21,13 +21,13 @@ struct sd_event; struct jobloop; extern int jobs_queue( - void *group, + const void *group, int timeout, void (*callback)(int signum, void* arg), void *arg); extern int jobs_enter( - void *group, + const void *group, int timeout, void (*callback)(int signum, void *closure, struct jobloop *jobloop), void *closure); @@ -35,7 +35,7 @@ extern int jobs_enter( extern int jobs_leave(struct jobloop *jobloop); extern int jobs_call( - void *group, + const void *group, int timeout, void (*callback)(int, void*), void *arg); |