futex: add missing locking in lockBuckets()

This was incorrectly dropped in cl/491486620.

PiperOrigin-RevId: 641272091
This commit is contained in:
Jamie Liu
2024-06-07 09:31:12 -07:00
committed by gVisor bot
parent e9e2a18631
commit b58e8a129d
+3 -5
View File
@@ -453,7 +453,8 @@ func (m *Manager) lockBuckets(k1, k2 *Key) (b1, b2, lockedFirst, lockedSecond *b
b1.mu.NestedLock(futexBucketLockB)
return b1, b2, b2, b1
}
return b1, b2, nil, nil // +checklocksforce
b1.mu.Lock()
return b1, b2, b1, nil // +checklocksforce
}
// unlockBuckets unlocks two buckets.
@@ -463,10 +464,7 @@ func (m *Manager) unlockBuckets(lockedFirst, lockedSecond *bucket) {
if lockedSecond != nil {
lockedSecond.mu.NestedUnlock(futexBucketLockB)
}
if lockedFirst != nil && lockedFirst != lockedSecond {
lockedFirst.mu.Unlock()
}
return
lockedFirst.mu.Unlock()
}
// Wake wakes up to n waiters matching the bitmask on the given addr.