mirror of
https://github.com/kopia/kopia.git
synced 2026-04-28 01:49:27 -04:00
Make Cache.mu a syncLocker
This commit is contained in:
committed by
Jarek Kowalski
parent
c3ffc435d7
commit
a445c80ef2
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user