loop: we can't actually use locked to stop the loop

We need to signal the event and wake up the loop to actually make it
stop and joinable.
This commit is contained in:
Wim Taymans 2025-05-30 12:07:47 +02:00
parent c45d667934
commit 820e0fccb1
2 changed files with 2 additions and 2 deletions

View file

@ -280,7 +280,7 @@ int pw_data_loop_stop(struct pw_data_loop *loop)
pthread_cancel(loop->thread); pthread_cancel(loop->thread);
} else { } else {
pw_log_debug("%p signal", loop); pw_log_debug("%p signal", loop);
pw_loop_locked(loop->loop, do_stop, 1, NULL, 0, loop); pw_loop_invoke(loop->loop, do_stop, 1, NULL, 0, false, loop);
} }
pw_log_debug("%p join", loop); pw_log_debug("%p join", loop);
if ((utils = loop->thread_utils) == NULL) if ((utils = loop->thread_utils) == NULL)

View file

@ -107,7 +107,7 @@ SPA_EXPORT
int pw_main_loop_quit(struct pw_main_loop *loop) int pw_main_loop_quit(struct pw_main_loop *loop)
{ {
pw_log_debug("%p: quit", loop); pw_log_debug("%p: quit", loop);
return pw_loop_locked(loop->loop, do_stop, 1, NULL, 0, loop); return pw_loop_invoke(loop->loop, do_stop, 1, NULL, 0, false, loop);
} }
/** Start a main loop /** Start a main loop