From fcd68bb0f872c65c4317377f787f5fdddea6e5d0 Mon Sep 17 00:00:00 2001 From: Jose Bollo Date: Wed, 6 Feb 2019 17:16:09 +0100 Subject: jobs: Ensure releasing event loop The internal functions blocking threads for implementing call_sync were not releasing the event loop, leading to deafness of the binder. Include a tuto-4 that reproduce the issue on a binder with the bug and that also shows interesting usages of the binder. Bug-AGL: SPEC-2161 Change-Id: I83ad4d55d721a6046e798a5e06967df4dd5a7284 Signed-off-by: Jose Bollo --- src/jobs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/jobs.c b/src/jobs.c index 4a88c303..d06d24cf 100644 --- a/src/jobs.c +++ b/src/jobs.c @@ -337,7 +337,7 @@ static void evloop_release() { struct thread *nh, *ct = current_thread; - if (evloop.holder == ct) { + if (ct && evloop.holder == ct) { nh = ct->nholder; evloop.holder = nh; if (nh) @@ -397,6 +397,7 @@ static void evloop_acquire() */ static void thread_enter(volatile struct thread *me) { + evloop_release(); /* initialize description of itself and link it in the list */ me->tid = pthread_self(); me->stop = 0; -- cgit 1.2.3-korg