mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 20:42:44 +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);
|
||||
|
||||
if (b->count++ == b->total) {
|
||||
b->count = 0;
|
||||
condvarWake(&b->condvar, b->total);
|
||||
b->count = 0;
|
||||
condvarWake(&b->condvar, b->total);
|
||||
}
|
||||
else {
|
||||
condvarWait(&b->condvar, &b->mutex);
|
||||
condvarWait(&b->condvar, &b->mutex);
|
||||
}
|
||||
|
||||
mutexUnlock(&b->mutex);
|
||||
|
Loading…
Reference in New Issue
Block a user