Avoid lock when child dies 78/22078/2
authorJose Bollo <jose.bollo@iot.bzh>
Fri, 2 Aug 2019 14:23:50 +0000 (16:23 +0200)
committerJosé Bollo <jose.bollo@iot.bzh>
Fri, 9 Aug 2019 14:34:43 +0000 (14:34 +0000)
commit6f13ad1989875b5a0ce50b24211fd1fba093735f
treee88b8447f6b282384ebaa009057c2871db7fb0ff
parent3343b4d0514d25fd1f2365eb25049f748cab688e
Avoid lock when child dies

Interaction between pthread_cond_wait, pthread_broadcast
and signal may lead to lock when the child of afb-daemon dies.

To avoid that sad behavior, this commit defers the call to
"job_exit" using lazy job queueing.

Bug-AGL: SPEC-2720

Change-Id: Ifd1a56f4a439e1704f79a1291fa01f39b1640f29
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
src/afb-session.c
src/main-afb-daemon.c