summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrederic Marec <frederic.marec@iot.bzh>2019-03-22 11:03:44 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2019-03-22 17:14:38 +0100
commit4789efd07382227aed86d8be8f91dd33bcb394d2 (patch)
treedcad318750369e603012a0e7e568bce7f4d441aa
parent3922f07ae1eda1de5d84832c25197296d1c10311 (diff)
jobs: Ensure validy of event loop
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>
-rw-r--r--src/jobs.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/jobs.c b/src/jobs.c
index d06d24cf..e75a1170 100644
--- a/src/jobs.c
+++ b/src/jobs.c
@@ -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;