tailscale/syncs
Joe Tsai 84aa7ff3bb
syncs: fix AtomicValue.CompareAndSwap (#16137)
Fix CompareAndSwap in the edge-case where
the underlying sync.AtomicValue is uninitialized
(i.e., Store was never called) and
the oldV is the zero value,
then perform CompareAndSwap with any(nil).

Also, document that T must be comparable.
This is a pre-existing restriction.

Fixes #16135

Signed-off-by: Joe Tsai <joetsai@digital-static.net>
2025-05-30 11:06:16 -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
shardedint_test.go syncs: add ShardedInt expvar.Var type 2024-12-19 14:58:28 -08:00
shardedint.go syncs: add ShardedInt expvar.Var type 2024-12-19 14:58:28 -08: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
shardvalue_go.go syncs: add ShardedInt expvar.Var type 2024-12-19 14:58:28 -08:00
shardvalue_tailscale.go syncs: add ShardedInt expvar.Var type 2024-12-19 14:58:28 -08:00
shardvalue_test.go syncs: add ShardedInt expvar.Var type 2024-12-19 14:58:28 -08:00
shardvalue.go syncs: add ShardedInt expvar.Var type 2024-12-19 14:58:28 -08:00
syncs_test.go syncs: fix AtomicValue.CompareAndSwap (#16137) 2025-05-30 11:06:16 -07:00
syncs.go syncs: fix AtomicValue.CompareAndSwap (#16137) 2025-05-30 11:06:16 -07:00