mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
loop: spa_loop_invoke -> spa_loop_locked where possible
When we simply need to change some state for the code executed in the loop, we can use locked() instead of invoke(). This is more efficient and avoids some context switches in the normal case.
This commit is contained in:
parent
b943c31fd8
commit
c45d667934
29 changed files with 75 additions and 75 deletions
|
|
@ -308,7 +308,7 @@ static int impl_node_set_io(void *object, uint32_t id, void *data, size_t size)
|
|||
if (this->started && following != this->following) {
|
||||
spa_log_debug(this->log, "%p: reassign follower %d->%d", this, this->following, following);
|
||||
this->following = following;
|
||||
spa_loop_invoke(this->data_loop, do_reassign_follower, 0, NULL, 0, true, this);
|
||||
spa_loop_locked(this->data_loop, do_reassign_follower, 0, NULL, 0, this);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -954,7 +954,7 @@ static void transport_stop(struct impl *this)
|
|||
|
||||
spa_log_trace(this->log, "sco-sink %p: transport stop", this);
|
||||
|
||||
spa_loop_invoke(this->data_loop, do_remove_transport_source, 0, NULL, 0, true, this);
|
||||
spa_loop_locked(this->data_loop, do_remove_transport_source, 0, NULL, 0, this);
|
||||
|
||||
if (this->buffer) {
|
||||
free(this->buffer);
|
||||
|
|
@ -978,7 +978,7 @@ static int do_stop(struct impl *this)
|
|||
|
||||
this->start_ready = false;
|
||||
|
||||
spa_loop_invoke(this->data_loop, do_remove_source, 0, NULL, 0, true, this);
|
||||
spa_loop_locked(this->data_loop, do_remove_source, 0, NULL, 0, this);
|
||||
|
||||
transport_stop(this);
|
||||
|
||||
|
|
@ -1571,7 +1571,7 @@ static void transport_destroy(void *data)
|
|||
{
|
||||
struct impl *this = data;
|
||||
spa_log_debug(this->log, "transport %p destroy", this->transport);
|
||||
spa_loop_invoke(this->data_loop, do_transport_destroy, 0, NULL, 0, true, this);
|
||||
spa_loop_locked(this->data_loop, do_transport_destroy, 0, NULL, 0, this);
|
||||
}
|
||||
|
||||
static const struct spa_bt_transport_events transport_events = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue