зеркало из https://github.com/github/ruby.git
Родитель
7a0dfdea8c
Коммит
054f56fd3e
|
@ -1643,6 +1643,24 @@ assert_match /\Atest_ractor\.rb:1:\s+warning:\s+Ractor is experimental/, %q{
|
||||||
eval("Ractor.new{}.take", nil, "test_ractor.rb", 1)
|
eval("Ractor.new{}.take", nil, "test_ractor.rb", 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# check moved object
|
||||||
|
assert_equal 'ok', %q{
|
||||||
|
r = Ractor.new do
|
||||||
|
Ractor.receive
|
||||||
|
GC.start
|
||||||
|
:ok
|
||||||
|
end
|
||||||
|
|
||||||
|
obj = begin
|
||||||
|
raise
|
||||||
|
rescue => e
|
||||||
|
e = Marshal.load(Marshal.dump(e))
|
||||||
|
end
|
||||||
|
|
||||||
|
r.send obj, move: true
|
||||||
|
r.take
|
||||||
|
}
|
||||||
|
|
||||||
## Ractor::Selector
|
## Ractor::Selector
|
||||||
|
|
||||||
# Selector#empty? returns true
|
# Selector#empty? returns true
|
||||||
|
|
2
ractor.c
2
ractor.c
|
@ -3491,6 +3491,8 @@ ractor_moved_bang(VALUE obj)
|
||||||
rv->v3 = 0;
|
rv->v3 = 0;
|
||||||
rv->flags = rv->flags & ~fl_users;
|
rv->flags = rv->flags & ~fl_users;
|
||||||
|
|
||||||
|
if (BUILTIN_TYPE(obj) == T_OBJECT) ROBJECT_SET_SHAPE_ID(obj, ROOT_SHAPE_ID);
|
||||||
|
|
||||||
// TODO: record moved location
|
// TODO: record moved location
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче