Commit 7460808
committed
🥅 Work around JRuby IO#close thread-safety issue
In CRuby, the same IO object generally can't be closed concurrently from
multiple threads thanks to the GVL. But also, it checks and double
checks whether or not the IO object has already been closed around
critical sections, and simply returns if it's already been closed.
JRuby seems to handle concurrent `IO#close` similarly to if the losing
thread were trying to read or write. So it can easily be triggered into
raise an IOError with "closed stream".1 parent 3a7f16c commit 7460808
1 file changed
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1215 | 1215 | | |
1216 | 1216 | | |
1217 | 1217 | | |
| 1218 | + | |
| 1219 | + | |
| 1220 | + | |
| 1221 | + | |
1218 | 1222 | | |
1219 | 1223 | | |
1220 | 1224 | | |
1221 | | - | |
| 1225 | + | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
1222 | 1232 | | |
1223 | 1233 | | |
1224 | 1234 | | |
| |||
0 commit comments