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.
This commit is contained in:
Wim Taymans 2021-03-10 13:01:19 +01:00
parent 0881d5b881
commit 4f816c1fb0

View file

@ -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);