mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-02 09:01:50 -05:00
thread-loop: only restore recurse on error
Only restore the previous recurse state when we fail to unlock.
This commit is contained in:
parent
aa2ea737c7
commit
edbfd180d0
1 changed files with 2 additions and 2 deletions
|
|
@ -60,10 +60,10 @@ static int do_unlock(struct pw_thread_loop *this)
|
||||||
int res;
|
int res;
|
||||||
spa_return_val_if_fail(this->recurse > 0, -EIO);
|
spa_return_val_if_fail(this->recurse > 0, -EIO);
|
||||||
this->recurse--;
|
this->recurse--;
|
||||||
if ((res = pthread_mutex_unlock(&this->lock)) != 0)
|
if ((res = pthread_mutex_unlock(&this->lock)) != 0) {
|
||||||
pw_log_error("%p: thread:%lu: %s", this, pthread_self(), strerror(res));
|
pw_log_error("%p: thread:%lu: %s", this, pthread_self(), strerror(res));
|
||||||
else
|
|
||||||
this->recurse++;
|
this->recurse++;
|
||||||
|
}
|
||||||
return -res;
|
return -res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue