loop: add method to run a function with the lock

Convert some _invoke to _locked
This commit is contained in:
Wim Taymans 2025-03-10 17:24:13 +01:00
parent fb49e0795c
commit f7fdafc203
18 changed files with 99 additions and 57 deletions

View file

@ -684,7 +684,7 @@ static void stop_driver_timer(struct impl *this)
/* Perform the actual stop within
* the dataloop to avoid data races. */
spa_loop_invoke(this->data_loop, do_remove_driver_timer_source, 0, NULL, 0, true, this);
spa_loop_locked(this->data_loop, do_remove_driver_timer_source, 0, NULL, 0, this);
}
static void on_driver_timeout(struct spa_source *source)
@ -795,7 +795,7 @@ static void reevaluate_following_state(struct impl *this)
if (following != this->following) {
spa_log_debug(this->log, "%p: following state changed: %d->%d", this, this->following, following);
this->following = following;
spa_loop_invoke(this->data_loop, do_reevaluate_following_state, 0, NULL, 0, true, this);
spa_loop_locked(this->data_loop, do_reevaluate_following_state, 0, NULL, 0, this);
}
}