added lock to dbStore.setCapacity

This commit is contained in:
zsfelfoldi 2015-02-09 17:21:45 +01:00
parent 0e07d1921e
commit b3ad5bd23e

View file

@ -345,6 +345,9 @@ func (s *dbStore) updateAccessCnt(key Key) {
func (s *dbStore) setCapacity(c uint64) { func (s *dbStore) setCapacity(c uint64) {
s.lock.Lock()
defer s.lock.Unlock()
s.capacity = c s.capacity = c
if s.entryCnt > c { if s.entryCnt > c {