From 4f816c1fb04e08c25c651ff11190d104ccc588bd Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Wed, 10 Mar 2021 13:01:19 +0100 Subject: [PATCH] loop: never try to block in the thread When we are calling invoke from the thread, the call will be completed in the thread and there is no need to block for completion. --- spa/plugins/support/loop.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spa/plugins/support/loop.c b/spa/plugins/support/loop.c index eaafc344e..3daac9450 100644 --- a/spa/plugins/support/loop.c +++ b/spa/plugins/support/loop.c @@ -187,7 +187,7 @@ loop_invoke(void *object, item->func = func; item->seq = seq; item->size = size; - item->block = block; + item->block = block && !in_thread; item->user_data = user_data; spa_log_trace(impl->log, NAME " %p: add item %p filled:%d", impl, item, filled); @@ -213,7 +213,7 @@ loop_invoke(void *object, loop_signal_event(impl, impl->wakeup); } - if (block) { + if (block && !in_thread) { uint64_t count = 1; spa_loop_control_hook_before(&impl->hooks_list);