Permalink
Browse files

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

…place where we actually do it
  • Loading branch information...
patrickmn committed Jun 22, 2012
1 parent aa7f52c commit 724bd0e963d90a9a721cfbd0bd12b9619540798f
Showing with 2 additions and 2 deletions.
  1. +2 −2 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()
}

0 comments on commit 724bd0e

Please sign in to comment.