Commit 83aea52
committed
Fix lock ordering in dist_monitor() to prevent SMP deadlock
Fix lock ordering in dist_monitor() to prevent SMP deadlock
Move synclist_append of remote_monitors after enif_monitor_process()
so the monitor is only visible to other threads once fully initialized.
This avoids a race where dist_connection_dtor could access a partially
initialized monitor entry, and ensures no nested locking occurs between
remote_monitors and the locks acquired inside enif_monitor_process.1 parent c4530b2 commit 83aea52
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
437 | 437 | | |
438 | 438 | | |
439 | 439 | | |
440 | | - | |
441 | 440 | | |
442 | 441 | | |
443 | | - | |
444 | 442 | | |
445 | 443 | | |
| 444 | + | |
| 445 | + | |
446 | 446 | | |
447 | 447 | | |
448 | 448 | | |
| |||
0 commit comments