mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* test/socket/test_unix.rb: don't use Thread.abort_on_exception.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9778737d7b
commit
e504a81ff1
2 changed files with 6 additions and 4 deletions
|
@ -1,3 +1,7 @@
|
||||||
|
Mon Jun 13 23:11:52 2011 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* test/socket/test_unix.rb: don't use Thread.abort_on_exception.
|
||||||
|
|
||||||
Mon Jun 13 23:05:01 2011 Tanaka Akira <akr@fsij.org>
|
Mon Jun 13 23:05:01 2011 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* ext/socket/unixsocket.c (unix_send_io): race condition fixed.
|
* ext/socket/unixsocket.c (unix_send_io): race condition fixed.
|
||||||
|
|
|
@ -108,8 +108,6 @@ class TestSocket_UNIXSocket < Test::Unit::TestCase
|
||||||
r1, w = IO.pipe
|
r1, w = IO.pipe
|
||||||
s1, s2 = UNIXSocket.pair
|
s1, s2 = UNIXSocket.pair
|
||||||
s1.nonblock = s2.nonblock = true
|
s1.nonblock = s2.nonblock = true
|
||||||
aoe = Thread.abort_on_exception
|
|
||||||
Thread.abort_on_exception = true
|
|
||||||
lock = Mutex.new
|
lock = Mutex.new
|
||||||
nr = 0
|
nr = 0
|
||||||
x = 2
|
x = 2
|
||||||
|
@ -125,13 +123,13 @@ class TestSocket_UNIXSocket < Test::Unit::TestCase
|
||||||
s2.recv_io.close
|
s2.recv_io.close
|
||||||
lock.synchronize { nr += 1 }
|
lock.synchronize { nr += 1 }
|
||||||
end
|
end
|
||||||
|
true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
(x * y).times { s1.send_io r1 }
|
(x * y).times { s1.send_io r1 }
|
||||||
thrs.each { |t| t.join }
|
assert_equal([true]*x, thrs.map { |t| t.value })
|
||||||
assert_equal x * y, nr
|
assert_equal x * y, nr
|
||||||
ensure
|
ensure
|
||||||
Thread.abort_on_exception = aoe
|
|
||||||
s1.close
|
s1.close
|
||||||
s2.close
|
s2.close
|
||||||
w.close
|
w.close
|
||||||
|
|
Loading…
Add table
Reference in a new issue