Commit 237f113
authored
Fix deadlock on Ctrl+C in server mode (ruby#1649)
## Summary
- Pressing Ctrl+C in `rdoc --server` raised `ThreadError: deadlock;
recursive locking` because the `INT` trap called `shutdown`, which
closed the TCP server socket from the same thread blocked on `accept`
- Replace trap-based shutdown with `rescue Interrupt` around the accept
loop, and move cleanup into an `ensure` block1 parent 3c6f5f6 commit 237f113
2 files changed
+3
-12
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
546 | 546 | | |
547 | 547 | | |
548 | 548 | | |
549 | | - | |
550 | | - | |
551 | | - | |
552 | | - | |
553 | 549 | | |
554 | 550 | | |
555 | 551 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
95 | | - | |
96 | 94 | | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
102 | | - | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
103 | 98 | | |
104 | 99 | | |
105 | 100 | | |
| |||
0 commit comments