mirror of
https://github.com/containers/podman.git
synced 2025-08-06 11:32:07 +08:00
system locks
now reports held locks
To debug a deadlock, we really want to know what lock is actually locked, so we can figure out what is using that lock. This PR adds support for this, using trylock to check if every lock on the system is free or in use. Will really need to be run a few times in quick succession to verify that it's not a transient lock and it's actually stuck, but that's not really a big deal. Signed-off-by: Matt Heon <mheon@redhat.com>
This commit is contained in:
@ -108,6 +108,10 @@ func (m *SHMLockManager) AvailableLocks() (*uint32, error) {
|
||||
return &avail, nil
|
||||
}
|
||||
|
||||
func (m *SHMLockManager) LocksHeld() ([]uint32, error) {
|
||||
return m.locks.GetTakenLocks()
|
||||
}
|
||||
|
||||
// SHMLock is an individual shared memory lock.
|
||||
type SHMLock struct {
|
||||
lockID uint32
|
||||
|
Reference in New Issue
Block a user