mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
test/ruby/test_thread.rb: use safe navigation operator.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
2d5b57d63c
commit
16f886328a
1 changed files with 6 additions and 5 deletions
|
@ -226,9 +226,9 @@ class TestThread < Test::Unit::TestCase
|
|||
assert_equal(t1, t3.value)
|
||||
|
||||
ensure
|
||||
t1.kill if t1
|
||||
t2.kill if t2
|
||||
t3.kill if t3
|
||||
t1&.kill
|
||||
t2&.kill
|
||||
t3&.kill
|
||||
end
|
||||
|
||||
{ 'FIXNUM_MAX' => RbConfig::LIMITS['FIXNUM_MAX'],
|
||||
|
@ -629,7 +629,8 @@ class TestThread < Test::Unit::TestCase
|
|||
end
|
||||
Thread.pass until t.stop?
|
||||
assert_predicate(t, :alive?)
|
||||
t.kill
|
||||
ensure
|
||||
t&.kill
|
||||
end
|
||||
|
||||
def test_mutex_deadlock
|
||||
|
@ -1111,7 +1112,7 @@ q.pop
|
|||
Thread.pass until mutex.locked?
|
||||
assert_equal(mutex.owned?, false)
|
||||
ensure
|
||||
th.kill if th
|
||||
th&.kill
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue