LibC: Fix pthread_cond_broadcast() waking only one thread

This commit is contained in:
LekKit 2024-03-21 20:09:21 +02:00 committed by Andrew Kaster
parent 0359e8848a
commit 760b9186a5
Notes: sideshowbarker 2024-07-18 00:41:35 +09:00

View File

@ -155,7 +155,7 @@ int pthread_cond_broadcast(pthread_cond_t* cond)
pthread_mutex_t* mutex = AK::atomic_load(&cond->mutex, AK::memory_order_relaxed);
VERIFY(mutex);
int rc = futex(&cond->value, FUTEX_REQUEUE | FUTEX_PRIVATE_FLAG, 1, nullptr, &mutex->lock, INT_MAX);
int rc = futex(&cond->value, FUTEX_REQUEUE | FUTEX_PRIVATE_FLAG, -1, nullptr, &mutex->lock, INT_MAX);
VERIFY(rc >= 0);
return 0;
}