Commit 68b1844
committed
Fix mutex_free so it doesn't call into Ruby code during GC
While freeing a locked mutex, if there is a waiter for the
mutex it could call `rb_fiber_scheduler_unblock` which calls
into Ruby code.
The function `rb_mutex_unlock_th` was a footgun because it was used
during normal Ruby code and also during GC. The fix is to not call this
function during GC and simply remove the mutex from th->keeping_mutexes.1 parent d0a2570 commit 68b1844
1 file changed
Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
| 106 | + | |
| 107 | + | |
106 | 108 | | |
107 | 109 | | |
108 | 110 | | |
109 | 111 | | |
110 | 112 | | |
111 | | - | |
112 | | - | |
| 113 | + | |
113 | 114 | | |
114 | 115 | | |
115 | 116 | | |
| |||
0 commit comments