tailscale/syncs
Joe Tsai 674beabc73
syncs: add Map.LoadFunc (#9869)
The LoadFunc loads a value and calls a user-provided function.
The utility of this method is to ensure that the map lock is held
while executing user-provided logic.
This allows us to solve TOCTOU bugs that would be nearly imposible
to the solve without this API.

Updates tailscale/corp#14772

Signed-off-by: Joe Tsai <joetsai@digital-static.net>
2023-10-18 15:02:45 -07:00
..
locked.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
locked_test.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
shardedmap.go syncs: add ShardedMap.Mutate 2023-06-28 08:43:15 -07:00
shardedmap_test.go syncs: add ShardedMap.Mutate 2023-06-28 08:43:15 -07:00
syncs.go syncs: add Map.LoadFunc (#9869) 2023-10-18 15:02:45 -07:00
syncs_test.go syncs: add Map.LoadFunc (#9869) 2023-10-18 15:02:45 -07:00
watchdog.go all: update copyright and license headers 2023-01-27 15:36:29 -08:00
watchdog_test.go syncs: relax TestWatchMultipleValues timing on Windows 2023-04-19 19:00:34 -07:00