mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-22 13:02:38 +02:00
Critical fix in new barrier impl
This commit is contained in:
parent
e8f3964475
commit
bf13da990a
@ -11,11 +11,11 @@ void barrierWait(Barrier *b) {
|
|||||||
mutexLock(&b->mutex);
|
mutexLock(&b->mutex);
|
||||||
|
|
||||||
if (b->count++ == b->total) {
|
if (b->count++ == b->total) {
|
||||||
b->count = 0;
|
b->count = 0;
|
||||||
condvarWake(&b->condvar, b->total);
|
condvarWake(&b->condvar, b->total);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
condvarWait(&b->condvar, &b->mutex);
|
condvarWait(&b->condvar, &b->mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
mutexUnlock(&b->mutex);
|
mutexUnlock(&b->mutex);
|
||||||
|
Loading…
Reference in New Issue
Block a user