X-Git-Url: https://gerrit.automotivelinux.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fjobs.c;h=380845d7ad0b15003d71b82172137a02d573c2c8;hb=cf1917f00d28381023d2e30f767adc5872b21084;hp=4a88c3036bc05b86cc840880b6e82d71c7e4d0b0;hpb=2ff91c09a03daaa21a0188fdbcdc62f1fb8874e5;p=src%2Fapp-framework-binder.git diff --git a/src/jobs.c b/src/jobs.c index 4a88c303..380845d7 100644 --- a/src/jobs.c +++ b/src/jobs.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2016, 2017, 2018 "IoT.bzh" + * Copyright (C) 2016-2019 "IoT.bzh" * Author José Bollo * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -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;