Skip to content

Commit

Permalink
MBARI 1
Browse files Browse the repository at this point in the history
  • Loading branch information
brentr committed Feb 14, 2009
1 parent cba16a2 commit bbf6a94
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
24 changes: 24 additions & 0 deletions eval.c
Expand Up @@ -13145,6 +13145,29 @@ rb_cont_call(argc, argv, cont)
}


/*
* call-seq:
* cont.thread
*
* Returns the thread on which this continuation can be called
* (or nil if that thread has died)
*
* t = Thread.new {callcc{|c| $x=c}; sleep 5}
* sleep 1
* $x.thread #=> t
* sleep 10
* $x.thread #=> nil
*/
static VALUE
rb_cont_thread(cont)
VALUE cont;
{
rb_thread_t th = THREAD_DATA(cont);
cc_purge(th);
return th->thread;
}


struct thgroup {
int enclosed;
VALUE group;
Expand Down Expand Up @@ -13498,6 +13521,7 @@ Init_Thread()
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_method(rb_cCont, "thread", rb_cont_thread, 0);
rb_define_global_function("callcc", rb_callcc, 0);
rb_global_variable(&cont_protect);

Expand Down
2 changes: 1 addition & 1 deletion version.h
Expand Up @@ -25,7 +25,7 @@ RUBY_EXTERN const char *ruby_copyright;
#define RUBY_BIRTH_MONTH 2
#define RUBY_BIRTH_DAY 24

#define RUBY_RELEASE_STR "MBARI 1- on patchlevel"
#define RUBY_RELEASE_STR "MBARI 1 on patchlevel"
#define RUBY_RELEASE_NUM RUBY_PATCHLEVEL


0 comments on commit bbf6a94

Please sign in to comment.