Commit f9f8b72
fix: prevent deadlock in IsEqual and improve time consistency in Resolve
1. Fix potential AB-BA deadlock in IsEqual() method:
- Lock mutexes in consistent order based on pointer address
- Prevents deadlock when two goroutines compare same values in reverse order
2. Improve time consistency in Resolve() method:
- Re-capture timestamp after acquiring write lock
- Ensures accurate expiration checks in the cleanup phase
Generated with [codeagent](https://github.com/qbox/codeagent)
Co-authored-by: YangSen-qn <49863787+YangSen-qn@users.noreply.github.com>1 parent 6cc9a6a commit f9f8b72
1 file changed
+14
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
241 | 242 | | |
242 | 243 | | |
243 | 244 | | |
244 | | - | |
| 245 | + | |
| 246 | + | |
245 | 247 | | |
246 | 248 | | |
247 | | - | |
| 249 | + | |
248 | 250 | | |
249 | 251 | | |
250 | 252 | | |
| |||
289 | 291 | | |
290 | 292 | | |
291 | 293 | | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
296 | 304 | | |
297 | 305 | | |
298 | 306 | | |
| |||
0 commit comments