Fix futexNeedsWake() on 64-bit systems
It was mistaking semaphore values over 0 as waiters, regardless of actual waiters. Pick-to: 6.1 Change-Id: Icebd01592ca8bdc1687a29dc569e3b630a262606 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
f3a042c5ab
commit
c2348e2c7a
@ -150,10 +150,11 @@ static int futexAvailCounter(quintptr v)
|
|||||||
|
|
||||||
static bool futexNeedsWake(quintptr v)
|
static bool futexNeedsWake(quintptr v)
|
||||||
{
|
{
|
||||||
// If we're counting waiters, the number of waiters is stored in the low 31
|
// If we're counting waiters, the number of waiters plus value is stored in the
|
||||||
// bits of the high word (that is, bits 32-62). If we're not, then we use
|
// low 31 bits of the high word (that is, bits 32-62). If we're not, then we only
|
||||||
// bit 31 to indicate anyone is waiting. Either way, if any bit 31 or above
|
// use futexNeedsWakeAllBit to indicate anyone is waiting.
|
||||||
// is set, there are waiters.
|
if constexpr (futexHasWaiterCount)
|
||||||
|
return (v >> 32) > (unsigned(v));
|
||||||
return v >> 31;
|
return v >> 31;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user