Sets the given value under the specified key.
(key string, value interface{})
| 87 | |
| 88 | // Sets the given value under the specified key. |
| 89 | func (m ConcurrentHashMap) Set(key string, value interface{}) { |
| 90 | // Get map shard. |
| 91 | shard := m.GetShard(key) |
| 92 | shard.Lock() |
| 93 | shard.items[key] = value |
| 94 | shard.Unlock() |
| 95 | } |
| 96 | |
| 97 | // Callback to return new element to be inserted into the map |
| 98 | // It is called while lock is held, therefore it MUST NOT |