Commit a029cb7
committed
fix: unlock l.mu before calling OnPotentialDeadlock callback
OnPotentialDeadlock is called while l.mu is held. If the callback
panics (e.g. to allow the goroutine to unwind while keeping other
goroutines running), l.mu remains locked, deadlocking all future
lock operations.
Unlock l.mu before calling the callback in both the recursive
lock and order violation detection paths. For the order violation
path, re-acquire l.mu afterward if the callback returns normally.
Fixes #291 parent c1cf6f8 commit a029cb7
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
427 | 427 | | |
428 | 428 | | |
429 | 429 | | |
| 430 | + | |
430 | 431 | | |
431 | | - | |
| 432 | + | |
432 | 433 | | |
433 | 434 | | |
434 | 435 | | |
| |||
454 | 455 | | |
455 | 456 | | |
456 | 457 | | |
| 458 | + | |
457 | 459 | | |
| 460 | + | |
458 | 461 | | |
459 | 462 | | |
460 | 463 | | |
| |||
0 commit comments