Add an interface, embed the mutex, and unexport some unnecessarily exported fields

This commit is contained in:
Patrick Mylund Nielsen
2012-07-04 19:34:37 +01:00
parent bf97a87cc7
commit 15cda21ff4
2 changed files with 64 additions and 49 deletions

View File

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