Don't expose the cache mutex

This commit is contained in:
Patrick Mylund Nielsen
2015-11-27 13:03:24 -05:00
parent a122e14c4b
commit a0136a8980
2 changed files with 147 additions and 147 deletions

View File

@@ -1549,10 +1549,10 @@ func BenchmarkCacheSetDeleteSingleLock(b *testing.B) {
tc := New(DefaultExpiration, 0)
b.StartTimer()
for i := 0; i < b.N; i++ {
tc.Lock()
tc.mu.Lock()
tc.set("foo", "bar", DefaultExpiration)
tc.delete("foo")
tc.Unlock()
tc.mu.Unlock()
}
}