Clear removes all items from map.
()
| 236 | |
| 237 | // Clear removes all items from map. |
| 238 | func (slm ShardLockMaps) Clear() { |
| 239 | for item := range slm.IterBuffered() { |
| 240 | slm.Remove(item.Key) |
| 241 | } |
| 242 | } |
| 243 | |
| 244 | // LockFuncWithKey executes a function with write lock on the shard containing the key. |
| 245 | // WARNING: Do not perform operations on the container within f to avoid deadlocks. |