Commit 1c2f5f8
fix(simpleradio): use atomic.Bool for secureCoalitionRadios
The TCP receiver goroutine writes c.secureCoalitionRadios from
updateServerSettings while the UDP receiver goroutine reads it from
the voice-packet handling path, with no synchronization — a data race
the Go race detector flags and an unlucky interleaving could let a
voice packet skip the coalition filter while the flag is flipping.
Switch the field to sync/atomic.Bool and route the write/read through
Store/Load. The tri-state log message ('enabling secure coalition
radios') still fires only on transitions, via a Load() check before
Store(true).
Refs dharmab/skyeye issue 661.
Signed-off-by: SAY-5 <say.apm35@gmail.com>1 parent 9967138 commit 1c2f5f8
3 files changed
Lines changed: 8 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
52 | | - | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
53 | 56 | | |
54 | 57 | | |
55 | 58 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | | - | |
| 84 | + | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
107 | | - | |
| 107 | + | |
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| |||
0 commit comments