mirror of
https://github.com/patrickmn/go-cache.git
synced 2025-10-07 08:30:51 +08:00
Don't expose the cache mutex
This commit is contained in:
@@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user