Make Cache.mu a syncLocker

This commit is contained in:
Julio Lopez
2019-11-15 11:26:35 -08:00
committed by Jarek Kowalski
parent c3ffc435d7
commit a445c80ef2

View File

@@ -23,7 +23,7 @@ type cacheEntry struct {
// Cache maintains in-memory cache of recently-read data to speed up filesystem operations.
type Cache struct {
mu sync.Mutex
mu sync.Locker
totalDirectoryEntries int
maxDirectories int
@@ -175,6 +175,7 @@ func NewCache(options *Options) *Cache {
}
return &Cache{
mu: &sync.Mutex{},
data: make(map[string]*cacheEntry),
maxDirectories: options.MaxCachedDirectories,
maxDirectoryEntries: options.MaxCachedEntries,