diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-23 10:17:50 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2009-03-23 10:17:50 +0000 |
commit | 78630e3a82afdea79220364d78aa4aea52ca100d (patch) | |
tree | 0110713f71edc4b80a7b0fd5c9425a675badf368 /test | |
parent | e8122fadd454723c4b557f30f53dbd3b88c1606d (diff) |
merge revision(s) 22011:
* ext/thread/thread.c (rb_queue_pop, rb_queue_push): should not lock
mutex if got an exception while waiting, and should ensure unlocked
after signaled. [ruby-dev:37545]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8_7@23049 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/thread/test_thread.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/thread/test_thread.rb b/test/thread/test_thread.rb index 44ae3b338d..699f4fe406 100644 --- a/test/thread/test_thread.rb +++ b/test/thread/test_thread.rb @@ -77,5 +77,14 @@ class TC_Thread < Test::Unit::TestCase assert_equal("exit.", result[/.*\Z/], '[ruby-dev:30653]') } end + + def test_queue_rescue + require "timeout" + queue = Queue.new + assert_raises(Timeout::Error) {Timeout.timeout(0.001) {queue.pop}} + queue.push(1) + assert_nothing_raised("[ruby-dev:37545]") {assert_equal(1, queue.pop)} + assert(queue.empty?) + end end |