mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
client: remove busy state from client in resource destroy
When a resource is doing an operation that sets the client in the busy state, make sure we unblock the client again when the resource is destroyed before we could complete the operation or else the client is stuck forever.
This commit is contained in:
parent
8f251fc7d4
commit
62dd58a604
3 changed files with 74 additions and 22 deletions
|
|
@ -112,19 +112,31 @@ static const struct pw_resource_events resource_events = {
|
|||
.destroy = global_unbind,
|
||||
};
|
||||
|
||||
static void impl_resource_pong(void *data, int seq)
|
||||
static void remove_pending(struct resource_data *d)
|
||||
{
|
||||
struct resource_data *d = data;
|
||||
|
||||
if (d->pong_seq == seq) {
|
||||
if (d->pong_seq != 0) {
|
||||
pw_impl_client_set_busy(pw_resource_get_client(d->resource), false);
|
||||
d->pong_seq = 0;
|
||||
d->impl->pending--;
|
||||
}
|
||||
}
|
||||
|
||||
static void impl_resource_destroy(void *data)
|
||||
{
|
||||
struct resource_data *d = data;
|
||||
remove_pending(d);
|
||||
}
|
||||
|
||||
static void impl_resource_pong(void *data, int seq)
|
||||
{
|
||||
struct resource_data *d = data;
|
||||
if (d->pong_seq == seq)
|
||||
remove_pending(d);
|
||||
}
|
||||
|
||||
static const struct pw_resource_events impl_resource_events = {
|
||||
PW_VERSION_RESOURCE_EVENTS,
|
||||
.destroy = impl_resource_destroy,
|
||||
.pong = impl_resource_pong,
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue