(key string, count int)
| 105 | } |
| 106 | |
| 107 | func (c *Cache) addPin(key string, count int) { |
| 108 | c.mu.Lock() |
| 109 | entry, ok := c.cache[key] |
| 110 | if ok { |
| 111 | entry.pinCount += count |
| 112 | c.used(entry) |
| 113 | } |
| 114 | c.mu.Unlock() |
| 115 | } |
| 116 | |
| 117 | // Pin a value in the cache if it exists |
| 118 | func (c *Cache) Pin(key string) { |