plugeth/common/lru
Martin Holst Swende 8334b5f51a
common/lru: fix race in lru (#26164)
This fixes a problem in the SizeConstrainedLRU. The SCLRU uses an underlying simple lru which is not thread safe.
During the Get operation, the recentness of the accessed item is updated, so it is not a pure read-operation. Therefore, the mutex we need is a full mutex, not RLock.

This PR changes the mutex to be a regular Mutex, instead of RWMutex, so a reviewer can at a glance see that all affected locations are fixed.
2022-11-11 19:48:36 +01:00
..
blob_lru_test.go core/state: replace fastcache code cache with gc-friendly structure (#26092) 2022-11-09 08:06:02 +01:00
blob_lru.go common/lru: fix race in lru (#26164) 2022-11-11 19:48:36 +01:00