summaryrefslogtreecommitdiff
path: root/ext/thread/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/thread/thread.c')
-rw-r--r--ext/thread/thread.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/ext/thread/thread.c b/ext/thread/thread.c
index cec8a5b4fa6..38b8a8c4e71 100644
--- a/ext/thread/thread.c
+++ b/ext/thread/thread.c
@@ -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);