thread-loop: only signal when option is set

Add a thead-loop.start-signal option that will do a signal before
entering the thread loop. Doing the signal in all cases can confuse
apps that don't expect the signal.

Make module-rt use the thread-loop.start-signal.

Fixes #3374
This commit is contained in:
Wim Taymans 2023-07-23 18:16:00 +02:00
parent 55812195ce
commit 920bb7160e
2 changed files with 13 additions and 2 deletions

View file

@ -1085,10 +1085,14 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
#ifdef HAVE_DBUS
impl->use_rtkit = use_rtkit;
if (impl->use_rtkit) {
struct spa_dict_item items[] = {
{ "thread-loop.start-signal", "true" }
};
if ((res = rtkit_get_bus(impl)) < 0)
goto error;
impl->thread_loop = pw_thread_loop_new("module-rt", NULL);
impl->thread_loop = pw_thread_loop_new("module-rt",
&SPA_DICT_INIT_ARRAY(items));
if (impl->thread_loop == NULL) {
res = -errno;
goto error;