From 90d755ab4cf97e6f360749d9dc8d1c430136da94 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Tue, 29 Mar 2022 10:48:11 +0200 Subject: [PATCH] thread-loop: we must be running to be in the thread --- src/pipewire/thread-loop.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pipewire/thread-loop.c b/src/pipewire/thread-loop.c index 31133bd12..f37a6e075 100644 --- a/src/pipewire/thread-loop.c +++ b/src/pipewire/thread-loop.c @@ -465,5 +465,5 @@ void pw_thread_loop_accept(struct pw_thread_loop *loop) SPA_EXPORT bool pw_thread_loop_in_thread(struct pw_thread_loop *loop) { - return pthread_self() == loop->thread; + return loop->running && pthread_self() == loop->thread; }