Do not ignore Lock()'s return value (#8142)

This commit is contained in:
Krishna Srinivas
2019-08-28 16:12:57 -07:00
committed by Harshavardhana
parent 83d4c5763c
commit 2ab0681c0c
5 changed files with 59 additions and 20 deletions
+4
View File
@@ -17,6 +17,7 @@
package cmd
import (
"errors"
"path"
"time"
)
@@ -53,6 +54,9 @@ type nameLockRequesterInfoPair struct {
lri lockRequesterInfo
}
var errLockConflict = errors.New("lock conflict")
var errLockNotExpired = errors.New("lock not expired")
// Similar to removeEntry but only removes an entry only if the lock entry exists in map.
func (l *localLocker) removeEntryIfExists(nlrip nameLockRequesterInfoPair) {
// Check if entry is still in map (could have been removed altogether by 'concurrent' (R)Unlock of last entry)