Commit d5d04dc
committed
istream/ThreadIstream: avoid unlocked drained read after reschedule
Internal::Done() may reschedule a new worker run before evaluating the
EOF/disposal condition. That condition read drained without holding
mutex, even though the new worker run can update drained under the
mutex concurrently.
Reorder the short-circuit condition so _again is tested first. This
avoids touching drained on the rescheduled path and removes the data
race without changing the state machine.1 parent ffd3051 commit d5d04dc
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
240 | | - | |
| 240 | + | |
241 | 241 | | |
242 | 242 | | |
243 | 243 | | |
| |||
0 commit comments