1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 04:27:43 +00:00

LibPthread: Fix asserting futex return value

FUTEX_WAIT returns the number of threads woken (if any).

Fixes #5032
This commit is contained in:
Tom 2021-01-21 14:43:07 -07:00 committed by Andreas Kling
parent efc091df81
commit 9943816e83

View file

@ -552,7 +552,7 @@ int pthread_cond_signal(pthread_cond_t* cond)
u32 value = cond->previous + 1;
cond->value = value;
int rc = futex(&cond->value, FUTEX_WAKE, 1, nullptr, nullptr, 0);
ASSERT(rc == 0);
ASSERT(rc >= 0);
return 0;
}
@ -561,7 +561,7 @@ int pthread_cond_broadcast(pthread_cond_t* cond)
u32 value = cond->previous + 1;
cond->value = value;
int rc = futex(&cond->value, FUTEX_WAKE, INT32_MAX, nullptr, nullptr, 0);
ASSERT(rc == 0);
ASSERT(rc >= 0);
return 0;
}