forked from TrueCloudLab/restic
Merge pull request #4175 from fergus-dall/deadlock-fix
Fix deadlock in Lock.Stale
This commit is contained in:
commit
49fa8fe6dd
1 changed files with 1 additions and 1 deletions
|
@ -222,7 +222,7 @@ var StaleLockTimeout = 30 * time.Minute
|
||||||
func (l *Lock) Stale() bool {
|
func (l *Lock) Stale() bool {
|
||||||
l.lock.Lock()
|
l.lock.Lock()
|
||||||
defer l.lock.Unlock()
|
defer l.lock.Unlock()
|
||||||
debug.Log("testing if lock %v for process %d is stale", l, l.PID)
|
debug.Log("testing if lock %v for process %d is stale", l.lockID, l.PID)
|
||||||
if time.Since(l.Time) > StaleLockTimeout {
|
if time.Since(l.Time) > StaleLockTimeout {
|
||||||
debug.Log("lock is stale, timestamp is too old: %v\n", l.Time)
|
debug.Log("lock is stale, timestamp is too old: %v\n", l.Time)
|
||||||
return true
|
return true
|
||||||
|
|
Loading…
Reference in a new issue