Skip to content

Commit

Permalink
Join threads.
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@46285 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
akr committed May 31, 2014
1 parent 4532872 commit 06fb823
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions test/ruby/test_marshal.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,21 @@ def test_userdef_encoding
def test_pipe
o1 = C.new("a" * 10000)

th = nil

o2 = IO.pipe do |r, w|
Thread.new {Marshal.dump(o1, w)}
th = Thread.new {Marshal.dump(o1, w)}
Marshal.load(r)
end
assert_equal(o1.str, o2.str)
th.join

o2 = IO.pipe do |r, w|
Thread.new {Marshal.dump(o1, w, 2)}
th = Thread.new {Marshal.dump(o1, w, 2)}
Marshal.load(r)
end
assert_equal(o1.str, o2.str)
th.join

assert_raise(TypeError) { Marshal.dump("foo", Object.new) }
assert_raise(TypeError) { Marshal.load(Object.new) }
Expand Down

0 comments on commit 06fb823

Please sign in to comment.