data-loop: check running state in _in_thread()

We can only be in the thread when the thread is running.
This commit is contained in:
Wim Taymans 2022-03-28 20:36:57 +02:00
parent 7e42c905a8
commit 9849d12009

View file

@ -246,7 +246,7 @@ int pw_data_loop_stop(struct pw_data_loop *loop)
SPA_EXPORT
bool pw_data_loop_in_thread(struct pw_data_loop * loop)
{
return pthread_equal(loop->thread, pthread_self());
return loop->running && pthread_equal(loop->thread, pthread_self());
}
/** Get the thread object.