mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
thread.c: undumpable
* ext/thread/thread.c (undumpable): ConditionVariable and Queue are not dumpable. [ruby-core:61677] [Bug #9674] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
f3867e2203
commit
1dd527012b
4 changed files with 35 additions and 0 deletions
|
@ -534,6 +534,13 @@ rb_szqueue_num_waiting(VALUE self)
|
|||
#define UNDER_THREAD 1
|
||||
#endif
|
||||
|
||||
static VALUE
|
||||
undumpable(VALUE obj)
|
||||
{
|
||||
rb_raise(rb_eTypeError, "can't dump %"PRIsVALUE, rb_obj_class(obj));
|
||||
UNREACHABLE;
|
||||
}
|
||||
|
||||
void
|
||||
Init_thread(void)
|
||||
{
|
||||
|
@ -573,12 +580,14 @@ Init_thread(void)
|
|||
|
||||
rb_define_method(rb_cConditionVariable, "initialize", rb_condvar_initialize, 0);
|
||||
rb_undef_method(rb_cConditionVariable, "initialize_copy");
|
||||
rb_define_method(rb_cConditionVariable, "marshal_dump", undumpable, 0);
|
||||
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, "marshal_dump", undumpable, 0);
|
||||
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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue