1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

pass DRb info to sub thread

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
seki 2005-02-13 15:44:36 +00:00
parent cb375567f6
commit 963c7a338d
3 changed files with 16 additions and 3 deletions

View file

@ -1,3 +1,9 @@
Mon Feb 14 00:40:49 2005 Masatoshi SEKI <m_seki@mva.biglobe.ne.jp>
* lib/ddrb/drb.rb (InvokeMethod.perform): pass DRb info to sub thread.
* test/drb/test_drb.rb (test_01_safe1_safe4_eval): fix test case.
Sun Feb 13 23:13:46 2005 Kouhei Sutou <kou@cozmixng.org>
* lib/rss/dublincore.rb (RSS::DublicCoreModel#date{,=}): added

View file

@ -1455,13 +1455,16 @@ module DRb
setup_message
if $SAFE < @safe_level
info = Thread.current['DRb']
if @block
@result = Thread.new {
Thread.current['DRb'] = info
$SAFE = @safe_level
perform_with_block
}.value
else
@result = Thread.new {
Thread.current['DRb'] = info
$SAFE = @safe_level
perform_without_block
}.value

View file

@ -241,12 +241,16 @@ class TestDRbEval < Test::Unit::TestCase
remote_class = four.remote_class
assert_equal(1, remote_class.class_eval('1'))
assert_equal(1, remote_class.module_eval('1'))
assert_raises(SecurityError) do
remote_class.class_eval('ENV.inspect')
remote_class.class_eval('ENV = {}')
end
assert_raises(SecurityError) do
remote_class.module_eval('ENV.inspect')
remote_class.module_eval('ENV = {}')
end
end
end