diff options
author | Koichi Sasada <ko1@atdot.net> | 2023-03-03 03:24:59 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2023-03-03 10:19:37 +0900 |
commit | 941d36d195691949afe2ce464b0d0aa20208e637 (patch) | |
tree | a2bb7e7ffc2929ad762d0a7227491acf6bb2d654 /encindex.h | |
parent | ddd3c92bf6555de8fc89fe81ed3d00d2f4a88275 (diff) | |
download | ruby-941d36d195691949afe2ce464b0d0aa20208e637.tar.gz |
fix timing bug
passing will and closing notification can conflict and
`Ractor::Selector#empty?` can return wrong answer.
This patch fix it.
```
s = Ractor::Selector.new
s.add Ractor.new{10}
s.add Ractor.new{20}
r, v = s.wait
vs = []
vs << v
r, v = s.wait
vs << v
[*vs.sort, s.empty?]
#=> "[10, 20, false]" (expected "[10, 20, true]")
```
Diffstat (limited to 'encindex.h')
0 files changed, 0 insertions, 0 deletions