diff options
author | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-03-21 19:35:06 +0000 |
---|---|---|
committer | nagachika <nagachika@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-03-21 19:35:06 +0000 |
commit | 410699b90e2bb1d2ac2c0d49c204d2576d8335a1 (patch) | |
tree | 8fcc308582d82a660721b377b90d2e5688f3206a | |
parent | c7edfc37fff5a1b6636e6582a882419cc32942c9 (diff) |
merge revision(s) r44681: [Backport #9440]
* 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/branches/ruby_2_1@50044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ext/thread/thread.c | 2 | ||||
-rw-r--r-- | test/thread/test_cv.rb | 8 | ||||
-rw-r--r-- | test/thread/test_queue.rb | 8 | ||||
-rw-r--r-- | version.h | 6 |
5 files changed, 26 insertions, 3 deletions
@@ -1,3 +1,8 @@ +Sun Mar 22 04:15:39 2015 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] + Wed Mar 18 02:42:37 2015 NAKAMURA Usaku <usa@ruby-lang.org> * win32/win32.c (w32_spawn): `v2` is used not only for `shell` but also diff --git a/ext/thread/thread.c b/ext/thread/thread.c index c3d81dc58d..c54396b927 100644 --- a/ext/thread/thread.c +++ b/ext/thread/thread.c @@ -590,12 +590,14 @@ Init_thread(void) rb_define_method(rb_cConditionVariable, "initialize", rb_condvar_initialize, 0); rb_define_method(rb_cConditionVariable, "marshal_dump", undumpable, 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_define_method(rb_cQueue, "marshal_dump", undumpable, 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); diff --git a/test/thread/test_cv.rb b/test/thread/test_cv.rb index 08459a0a04..53f3261390 100644 --- a/test/thread/test_cv.rb +++ b/test/thread/test_cv.rb @@ -195,6 +195,14 @@ 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 + (DumpableCV = ConditionVariable.dup).class_eval {remove_method :marshal_dump} def test_dump diff --git a/test/thread/test_queue.rb b/test/thread/test_queue.rb index 314ee98dab..c33cb6dc8a 100644 --- a/test/thread/test_queue.rb +++ b/test/thread/test_queue.rb @@ -220,6 +220,14 @@ class TestQueue < Test::Unit::TestCase end end + def test_dup + bug9440 = '[ruby-core:59961] [Bug #9440]' + q = Queue.new + assert_raise(NoMethodError, bug9440) do + q.dup + end + end + (DumpableQueue = Queue.dup).class_eval {remove_method :marshal_dump} def test_dump @@ -1,10 +1,10 @@ #define RUBY_VERSION "2.1.5" -#define RUBY_RELEASE_DATE "2015-03-18" -#define RUBY_PATCHLEVEL 319 +#define RUBY_RELEASE_DATE "2015-03-22" +#define RUBY_PATCHLEVEL 320 #define RUBY_RELEASE_YEAR 2015 #define RUBY_RELEASE_MONTH 3 -#define RUBY_RELEASE_DAY 18 +#define RUBY_RELEASE_DAY 22 #include "ruby/version.h" |