jobs: Refactor exiting jobs
authorJosé Bollo <jose.bollo@iot.bzh>
Fri, 15 Feb 2019 19:49:54 +0000 (20:49 +0100)
committerJosé Bollo <jose.bollo@iot.bzh>
Fri, 22 Mar 2019 11:21:54 +0000 (12:21 +0100)
commit79d63b68dd5f4047a49ac178094afb2c206c167f
tree1e1ee045a6fa327c1eb9d1b1673d417f33c76e21
parent81f9cf2f0ca3ec74ffeb3092231d85023013315d
jobs: Refactor exiting jobs

The new termination function can allow the restart
because it doesn't abort the waiting jobs.

So after calling 'jobs_exit', all threads stop.
The function 'job_start' returns.

The threads that are in blocking state, i.e. in
a call to 'jobs_enter' or 'jobs_call' are stopped.
An error status -1 with errno=EINTR is returned in
that case.

But before returning, that function calls the exit
handler if any.

Change-Id: I85a4b1976b09b18804eb681af940531ae5ace6c3
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
src/jobs.c
src/jobs.h
src/main-afb-daemon.c