mirror of
https://github.com/docker/cli.git
synced 2026-01-13 18:22:35 +03:00
Fix RefCounter count return
Signed-off-by: Alfred Landrum <alfred.landrum@docker.com> Upstream-commit: 874a502b1deea1019dab23e2b5ead9c792925e40 Component: engine
This commit is contained in:
@@ -40,8 +40,9 @@ func (c *RefCounter) Increment(path string) int {
|
||||
}
|
||||
}
|
||||
m.count++
|
||||
count := m.count
|
||||
c.mu.Unlock()
|
||||
return m.count
|
||||
return count
|
||||
}
|
||||
|
||||
// Decrement decreases the ref count for the given id and returns the current count
|
||||
@@ -62,6 +63,7 @@ func (c *RefCounter) Decrement(path string) int {
|
||||
}
|
||||
}
|
||||
m.count--
|
||||
count := m.count
|
||||
c.mu.Unlock()
|
||||
return m.count
|
||||
return count
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user