Test the right condition for the EBUSY return in pthread_barrier_destroy().

This commit is contained in:
David Young
2020-02-27 10:17:24 -06:00
parent 802bf2dc1e
commit 11d22f3ea5

View File

@@ -122,7 +122,7 @@ pthread_barrier_destroy(pthread_barrier_t *barrier)
barrier_lock(barrier);
if (barrier->magic != barrier_magic)
rc = EINVAL;
else if (barrier->count != 0)
else if (barrier->nentered % barrier->count != 0)
rc = EBUSY;
else {
rc = 0;