mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
futex: add missing locking in lockBuckets()
This was incorrectly dropped in cl/491486620. PiperOrigin-RevId: 641272091
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user