mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
thread/thread.c: no dup
* ext/thread/thread.c (Init_thread): ConditionVariable and Queue are not able to copy. [ruby-core:59961] [Bug #9440] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@44681 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
a658a5ae53
commit
06d2e8aaf7
4 changed files with 23 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
Wed Jan 22 15:59:39 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* ext/thread/thread.c (Init_thread): ConditionVariable and Queue
|
||||
are not able to copy. [ruby-core:59961] [Bug #9440]
|
||||
|
||||
Tue Jan 21 20:14:55 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* thread_pthread.c (rb_thread_create_timer_thread): fix for platforms
|
||||
|
|
|
@ -572,11 +572,13 @@ Init_thread(void)
|
|||
id_sleep = rb_intern("sleep");
|
||||
|
||||
rb_define_method(rb_cConditionVariable, "initialize", rb_condvar_initialize, 0);
|
||||
rb_undef_method(rb_cConditionVariable, "initialize_copy");
|
||||
rb_define_method(rb_cConditionVariable, "wait", rb_condvar_wait, -1);
|
||||
rb_define_method(rb_cConditionVariable, "signal", rb_condvar_signal, 0);
|
||||
rb_define_method(rb_cConditionVariable, "broadcast", rb_condvar_broadcast, 0);
|
||||
|
||||
rb_define_method(rb_cQueue, "initialize", rb_queue_initialize, 0);
|
||||
rb_undef_method(rb_cQueue, "initialize_copy");
|
||||
rb_define_method(rb_cQueue, "push", rb_queue_push, 1);
|
||||
rb_define_method(rb_cQueue, "pop", rb_queue_pop, -1);
|
||||
rb_define_method(rb_cQueue, "empty?", rb_queue_empty_p, 0);
|
||||
|
|
|
@ -188,4 +188,12 @@ INPUT
|
|||
|
||||
assert_nothing_raised(Exception) { mutex.synchronize {condvar.broadcast} }
|
||||
end
|
||||
|
||||
def test_dup
|
||||
bug9440 = '[ruby-core:59961] [Bug #9440]'
|
||||
condvar = ConditionVariable.new
|
||||
assert_raise(NoMethodError, bug9440) do
|
||||
condvar.dup
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -200,4 +200,12 @@ class TestQueue < Test::Unit::TestCase
|
|||
timeout(1) { th2.join }
|
||||
end
|
||||
end
|
||||
|
||||
def test_dup
|
||||
bug9440 = '[ruby-core:59961] [Bug #9440]'
|
||||
q = Queue.new
|
||||
assert_raise(NoMethodError, bug9440) do
|
||||
q.dup
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue