aboutsummaryrefslogtreecommitdiffstats
path: root/src/jobs.c
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2017-11-17 16:51:02 +0100
committerJosé Bollo <jose.bollo@iot.bzh>2017-11-17 17:02:33 +0100
commitba1f3e26cb5f5f3e95480cb5c6a519a87c4c5d88 (patch)
tree89f6418dbe20fb37a8fafd7d50069951e185f117 /src/jobs.c
parent8cbdf0a5cb4d9abf0684344a28746a21dfc36ac3 (diff)
afb-proto-ws: Fix autolock in proto-ws
Because a systemd event loop can not be reentered while evaluating an event callback, the event loop was removed from the threads. It had the effect to enter in deadlock when calling a synchronous call while in an event callback. Queueing a job solves the issue. But because using queued job has implications on libafbws, a fake job manager is added for libafbws. Change-Id: Id793bea55743790082eaab48cd4cc87f7993772a Signed-off-by: José Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/jobs.c')
-rw-r--r--src/jobs.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/jobs.c b/src/jobs.c
index b7d16112..78131fcd 100644
--- a/src/jobs.c
+++ b/src/jobs.c
@@ -363,8 +363,10 @@ static void thread_run(volatile struct thread *me)
events = current_events;
if (!events)
events = events_get();
- else if (events->state == Locked)
+ else if (events->state == Locked) {
events = 0;
+ AFB_WARNING("Loosing an event loop because reentering");
+ }
if (events) {
/* run the events */
events->state = Locked;