Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Move comment explaining the manual mutex unlocking down to the first …

…place where we actually do it
  • Loading branch information...
commit 724bd0e963d90a9a721cfbd0bd12b9619540798f 1 parent aa7f52c
Patrick Mylund Nielsen authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 cache.go
4 cache.go
View
@@ -34,8 +34,6 @@ type Cache struct {
type cache struct {
DefaultExpiration time.Duration
Items map[string]*Item
- // TODO: Calls to mu.Unlock are currently not deferred because defer
- // adds ~200 ns (as of 792c7561af4b+ tip.)
mu sync.Mutex
janitor *janitor
}
@@ -45,6 +43,8 @@ type cache struct {
func (c *cache) Set(k string, x interface{}, d time.Duration) {
c.mu.Lock()
c.set(k, x, d)
+ // TODO: Calls to mu.Unlock are currently not deferred because defer
+ // adds ~200 ns (as of go1.)
c.mu.Unlock()
}
Please sign in to comment.
Something went wrong with that request. Please try again.