mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-03 09:01:54 -05:00
add some SPA_LIKELY
This commit is contained in:
parent
e3b6534872
commit
abcf7cb8d8
2 changed files with 16 additions and 16 deletions
|
|
@ -40,11 +40,11 @@ int pw_data_loop_wait(struct pw_data_loop *this, int timeout)
|
|||
int res;
|
||||
|
||||
while (true) {
|
||||
if (!this->running) {
|
||||
if (SPA_UNLIKELY(!this->running)) {
|
||||
res = -ECANCELED;
|
||||
break;
|
||||
}
|
||||
if ((res = pw_loop_iterate(this->loop, timeout)) < 0) {
|
||||
if (SPA_UNLIKELY((res = pw_loop_iterate(this->loop, timeout)) < 0)) {
|
||||
if (res == -EINTR)
|
||||
continue;
|
||||
}
|
||||
|
|
@ -77,8 +77,8 @@ static void *do_loop(void *user_data)
|
|||
|
||||
pthread_cleanup_push(thread_cleanup, this);
|
||||
|
||||
while (this->running) {
|
||||
if ((res = pw_loop_iterate(this->loop, -1)) < 0) {
|
||||
while (SPA_LIKELY(this->running)) {
|
||||
if (SPA_UNLIKELY((res = pw_loop_iterate(this->loop, -1)) < 0)) {
|
||||
if (res == -EINTR)
|
||||
continue;
|
||||
pw_log_error("%p: iterate error %d (%s)",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue