Open Cyufei87 opened 3 years ago
sort of...getValue()
checks if the item has expired, and deletes it if it has. So you'd have to convert the reader lock to a full lock.
Also the cache engine supports a loaderFunc
that will attempt to generate a value if it's not found in the cache. That would also require a real Lock.
https://github.com/bluele/gcache/blob/ecee3be431d11477f158fa979219e6e90c20213e/simple.go#L123 can here use RLock to decrease lock race?