summaryrefslogtreecommitdiff
path: root/thread.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-07 13:44:11 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-02-07 13:44:11 +0000
commit0eaefd202a7072aea6a17993c19c8704366ed9f7 (patch)
treebfa21cea32a35b9e284a3d092796a6d5febf6c8a /thread.c
parent0b91bd56c2246f4a6dc313e0972a28074c68ecee (diff)
* eval_intern.h: remove UNSUPPORTED() macro.
* thread.c: fix to define Continuation methods (they only do rb_notimplement()). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11655 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/thread.c b/thread.c
index 792835fa5d..f2e9e775b8 100644
--- a/thread.c
+++ b/thread.c
@@ -2171,7 +2171,7 @@ VALUE rb_cCont;
static VALUE
rb_callcc(VALUE self)
{
- UNSUPPORTED(rb_callcc);
+ rb_notimplement();
return Qnil;
}
@@ -2194,7 +2194,8 @@ rb_callcc(VALUE self)
static VALUE
rb_cont_call(int argc, VALUE *argv, VALUE cont)
{
- UNSUPPORTED(rb_cont_call);
+ rb_notimplement();
+ return Qnil;
}
/* variables for recursive traversals */
@@ -2371,7 +2372,13 @@ Init_Thread(void)
recursive_key = rb_intern("__recursive_key__");
rb_eThreadError = rb_define_class("ThreadError", rb_eStandardError);
+
rb_cCont = rb_define_class("Continuation", rb_cObject);
+ rb_undef_alloc_func(rb_cCont);
+ rb_undef_method(CLASS_OF(rb_cCont), "new");
+ rb_define_method(rb_cCont, "call", rb_cont_call, -1);
+ rb_define_method(rb_cCont, "[]", rb_cont_call, -1);
+ rb_define_global_function("callcc", rb_callcc, 0);
Init_native_thread();
{