git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@887 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
matz 2000-08-09 11:17:25 +00:00
Родитель 6155633068
Коммит db537ebae3
1 изменённых файлов: 4 добавлений и 5 удалений

9
eval.c
Просмотреть файл

@ -8092,16 +8092,15 @@ rb_callcc(self)
struct tag *tag; struct tag *tag;
THREAD_ALLOC(th); THREAD_ALLOC(th);
th->status = THREAD_KILLED; cont = Data_Wrap_Struct(rb_cCont, thread_mark,
th->thread = cont = Data_Wrap_Struct(rb_cCont, thread_mark,
thread_free, th); thread_free, th);
FL_SET(ruby_scope, SCOPE_DONT_RECYCLE); FL_SET(ruby_scope, SCOPE_DONT_RECYCLE);
for (tag=prot_tag; tag; tag=tag->prev) { for (tag=prot_tag; tag; tag=tag->prev) {
scope_dup(tag->scope); scope_dup(tag->scope);
} }
th->prev = 0; th->prev = th->next = 0;
th->next = curr_thread; th->thread = curr_thread->thread;
if (THREAD_SAVE_CONTEXT(th)) { if (THREAD_SAVE_CONTEXT(th)) {
return th->result; return th->result;
} }
@ -8118,7 +8117,7 @@ rb_cont_call(argc, argv, cont)
{ {
rb_thread_t th = rb_thread_check(cont); rb_thread_t th = rb_thread_check(cont);
if (th->next != curr_thread) { if (th->thread != curr_thread->thread) {
rb_raise(rb_eRuntimeError, "continuation called across threads"); rb_raise(rb_eRuntimeError, "continuation called across threads");
} }
switch (argc) { switch (argc) {