QSemaphore: emit waking on the same word size as we wait on
futexSemaphoreTryAcquire_loop() always waits on 32-bit portions of
QSemaphore. The current implementations only look at the pointer address
and don't care what size the waiter used. That's not the case for the
Darwin/macOS implementation:
In xnu/bsd/kern/sys_ulock.c:ulock_wake[1]:
if (opcode != ull->ull_opcode) {
ret = EDOM;
goto out_ull_put;
}
[1] 5c2921b07a/bsd/kern/sys_ulock.c (L970-L973)
Change-Id: I63b988479db546dabffcfffd1766c5eae61187f0
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
This commit is contained in:
parent
207954d5f0
commit
0f9894f79b
@ -379,12 +379,9 @@ void QSemaphore::release(int n)
|
|||||||
// its acquisition anyway, so it has to wait;
|
// its acquisition anyway, so it has to wait;
|
||||||
// 2) it did not see the new counter value, in which case its
|
// 2) it did not see the new counter value, in which case its
|
||||||
// futexWait will fail.
|
// futexWait will fail.
|
||||||
if (futexHasWaiterCount) {
|
futexWakeAll(*futexLow32(&u));
|
||||||
futexWakeAll(*futexLow32(&u));
|
if (futexHasWaiterCount)
|
||||||
futexWakeAll(*futexHigh32(&u));
|
futexWakeAll(*futexHigh32(&u));
|
||||||
} else {
|
|
||||||
futexWakeAll(u);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user