jobs: Ensure validy of event loop 81/20781/1
authorFrederic Marec <frederic.marec@iot.bzh>
Fri, 22 Mar 2019 10:03:44 +0000 (11:03 +0100)
committerJosé Bollo <jose.bollo@iot.bzh>
Fri, 22 Mar 2019 16:14:38 +0000 (17:14 +0100)
In rare circumstances during intialization threads should wait instead
of using a null event loop. This is because no one has needed event loop at
this stage of initialization.

Change-Id: I05b6ddbc05bec50958d0981213219b1d641401a5
Signed-off-by: Frederic Marec <frederic.marec@iot.bzh>
src/jobs.c

index d06d24c..e75a117 100644 (file)
@@ -355,6 +355,9 @@ static int evloop_get()
        if (evloop.holder)
                return evloop.holder == ct;
 
+       if (!evloop.sdev)
+               return 0;
+
        ct->nholder = NULL;
        evloop.holder = ct;
        return 1;