test_thread: test_condvar_wait_not_owner duplicates test_condvar_nolock
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35093 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
ded27bf5dc
commit
1e42030f2a
@ -82,7 +82,7 @@ class ConditionVariable
|
|||||||
#
|
#
|
||||||
def signal
|
def signal
|
||||||
begin
|
begin
|
||||||
t = @waiters_mutex.synchronize { @waiters.shift }
|
t = @waiters_mutex.synchronize {@waiters.shift}
|
||||||
t.run if t
|
t.run if t
|
||||||
rescue ThreadError
|
rescue ThreadError
|
||||||
retry
|
retry
|
||||||
|
@ -67,13 +67,6 @@ class TestThread < Test::Unit::TestCase
|
|||||||
assert_equal([0, 1, 2], result)
|
assert_equal([0, 1, 2], result)
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_condvar_wait_not_owner
|
|
||||||
mutex = Mutex.new
|
|
||||||
condvar = ConditionVariable.new
|
|
||||||
|
|
||||||
assert_raise(ThreadError) { condvar.wait(mutex) }
|
|
||||||
end
|
|
||||||
|
|
||||||
def test_condvar_wait_exception_handling
|
def test_condvar_wait_exception_handling
|
||||||
# Calling wait in the only thread running should raise a ThreadError of
|
# Calling wait in the only thread running should raise a ThreadError of
|
||||||
# 'stopping only thread'
|
# 'stopping only thread'
|
||||||
@ -194,7 +187,7 @@ class TestThread < Test::Unit::TestCase
|
|||||||
mutex = Mutex.new
|
mutex = Mutex.new
|
||||||
condvar = ConditionVariable.new
|
condvar = ConditionVariable.new
|
||||||
|
|
||||||
assert_raise(ThreadError) { condvar.wait(mutex) }
|
assert_raise(ThreadError) {condvar.wait(mutex)}
|
||||||
end
|
end
|
||||||
|
|
||||||
def test_condvar_nolock_2
|
def test_condvar_nolock_2
|
||||||
|
Loading…
x
Reference in New Issue
Block a user