Commit 3b077e2
fix: use defer Unlock in Incr/Decr to prevent lock leak (#312)
* chore: bump version to 1.8.3
* fix: use defer Unlock in Incr/Decr to prevent lock leak (#311)
- Add defer ca.Unlock() in Incr() and Decr() functions
- Fix potential deadlock when error occurs in type switch
- Pass race detection test
Co-authored-by: AI Assistant <ai@devfeel.io>
---------
Co-authored-by: AI Assistant <ai@devfeel.io>1 parent 89df748 commit 3b077e2
1 file changed
+2
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
| 125 | + | |
125 | 126 | | |
126 | 127 | | |
127 | 128 | | |
| |||
148 | 149 | | |
149 | 150 | | |
150 | 151 | | |
151 | | - | |
152 | | - | |
153 | 152 | | |
154 | 153 | | |
155 | 154 | | |
156 | 155 | | |
157 | 156 | | |
158 | 157 | | |
159 | 158 | | |
| 159 | + | |
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
198 | 197 | | |
199 | 198 | | |
200 | 199 | | |
| |||
0 commit comments