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 11:15:22 +0000
commit6f192ac5b7aeca2070a02e74397a2c97977147ca (patch)
tree095989c9e55ba14b728badb9b58aa3b5ec7c9007
parentb66e184f26629a333465d1908d7f0384ce5cc5f5 (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 380845d7..9680699d 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;