Skip to content

Commit 410699b

Browse files
committed
merge revision(s) r44681: [Backport ruby#9440]
* ext/thread/thread.c (Init_thread): ConditionVariable and Queue are not able to copy. [ruby-core:59961] [Bug ruby#9440] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_1@50044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent c7edfc3 commit 410699b

File tree

5 files changed

+26
-3
lines changed

5 files changed

+26
-3
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
Sun Mar 22 04:15:39 2015 Nobuyoshi Nakada <[email protected]>
2+
3+
* ext/thread/thread.c (Init_thread): ConditionVariable and Queue
4+
are not able to copy. [ruby-core:59961] [Bug #9440]
5+
16
Wed Mar 18 02:42:37 2015 NAKAMURA Usaku <[email protected]>
27

38
* win32/win32.c (w32_spawn): `v2` is used not only for `shell` but also

ext/thread/thread.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -590,12 +590,14 @@ Init_thread(void)
590590

591591
rb_define_method(rb_cConditionVariable, "initialize", rb_condvar_initialize, 0);
592592
rb_define_method(rb_cConditionVariable, "marshal_dump", undumpable, 0);
593+
rb_undef_method(rb_cConditionVariable, "initialize_copy");
593594
rb_define_method(rb_cConditionVariable, "wait", rb_condvar_wait, -1);
594595
rb_define_method(rb_cConditionVariable, "signal", rb_condvar_signal, 0);
595596
rb_define_method(rb_cConditionVariable, "broadcast", rb_condvar_broadcast, 0);
596597

597598
rb_define_method(rb_cQueue, "initialize", rb_queue_initialize, 0);
598599
rb_define_method(rb_cQueue, "marshal_dump", undumpable, 0);
600+
rb_undef_method(rb_cQueue, "initialize_copy");
599601
rb_define_method(rb_cQueue, "push", rb_queue_push, 1);
600602
rb_define_method(rb_cQueue, "pop", rb_queue_pop, -1);
601603
rb_define_method(rb_cQueue, "empty?", rb_queue_empty_p, 0);

test/thread/test_cv.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,14 @@ def test_condvar_empty_broadcast
195195
assert_nothing_raised(Exception) { mutex.synchronize {condvar.broadcast} }
196196
end
197197

198+
def test_dup
199+
bug9440 = '[ruby-core:59961] [Bug #9440]'
200+
condvar = ConditionVariable.new
201+
assert_raise(NoMethodError, bug9440) do
202+
condvar.dup
203+
end
204+
end
205+
198206
(DumpableCV = ConditionVariable.dup).class_eval {remove_method :marshal_dump}
199207

200208
def test_dump

test/thread/test_queue.rb

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,14 @@ def test_queue_thread_raise
220220
end
221221
end
222222

223+
def test_dup
224+
bug9440 = '[ruby-core:59961] [Bug #9440]'
225+
q = Queue.new
226+
assert_raise(NoMethodError, bug9440) do
227+
q.dup
228+
end
229+
end
230+
223231
(DumpableQueue = Queue.dup).class_eval {remove_method :marshal_dump}
224232

225233
def test_dump

version.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
#define RUBY_VERSION "2.1.5"
2-
#define RUBY_RELEASE_DATE "2015-03-18"
3-
#define RUBY_PATCHLEVEL 319
2+
#define RUBY_RELEASE_DATE "2015-03-22"
3+
#define RUBY_PATCHLEVEL 320
44

55
#define RUBY_RELEASE_YEAR 2015
66
#define RUBY_RELEASE_MONTH 3
7-
#define RUBY_RELEASE_DAY 18
7+
#define RUBY_RELEASE_DAY 22
88

99
#include "ruby/version.h"
1010

0 commit comments

Comments
 (0)