tailscale/syncs
Joe Tsai 5b7303817e
syncs: allocate map with Map.WithLock (#13755)
One primary purpose of WithLock is to mutate the underlying map.
However, this can lead to a panic if it happens to be nil.
Thus, always allocate a map before passing it to f.

Updates tailscale/corp#11038

Signed-off-by: Joe Tsai <joetsai@digital-static.net>
2024-10-09 14:03:37 -07:00
..
locked_test.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
locked.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
pool_test.go syncs: add generic Pool (#12759) 2024-07-10 09:39:52 -07:00
pool.go syncs: add generic Pool (#12759) 2024-07-10 09:39:52 -07:00
shardedmap_test.go syncs: add ShardedMap.Mutate 2023-06-28 08:43:15 -07:00
shardedmap.go syncs: add ShardedMap.Mutate 2023-06-28 08:43:15 -07:00
syncs_test.go syncs: delete Map.Range, update callers to iterators 2024-10-09 13:56:13 -07:00
syncs.go syncs: allocate map with Map.WithLock (#13755) 2024-10-09 14:03:37 -07:00