зеркало из https://github.com/github/ruby.git
* eval.c (rb_thread_start_0): update curr_thread before raising
TAG_THREAD. [ruby-dev:25712] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@8014 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
984f9a0df1
Коммит
9001cbdfad
|
@ -19,6 +19,11 @@ Tue Feb 22 23:50:26 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
|||
* signal.c (ruby_signal, ruby_nativethread_signal): must be valid as
|
||||
expressions, not only statements.
|
||||
|
||||
Tue Feb 22 12:54:13 2005 Yukihiro Matsumoto <matz@ruby-lang.org>
|
||||
|
||||
* eval.c (rb_thread_start_0): update curr_thread before raising
|
||||
TAG_THREAD. [ruby-dev:25712]
|
||||
|
||||
Tue Feb 22 07:24:57 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* parse.y (parser_yylex): identifier after dot must not be a variable.
|
||||
|
|
20
eval.c
20
eval.c
|
@ -9941,6 +9941,11 @@ thread_mark(th)
|
|||
}
|
||||
}
|
||||
|
||||
static struct {
|
||||
rb_thread_t thread;
|
||||
VALUE proc, arg;
|
||||
} new_thread;
|
||||
|
||||
void
|
||||
rb_gc_mark_threads()
|
||||
{
|
||||
|
@ -9953,6 +9958,11 @@ rb_gc_mark_threads()
|
|||
FOREACH_THREAD(th) {
|
||||
rb_gc_mark(th->thread);
|
||||
} END_FOREACH(th);
|
||||
if (new_thread.thread) {
|
||||
rb_gc_mark(new_thread.thread->thread);
|
||||
rb_gc_mark(new_thread.proc);
|
||||
rb_gc_mark(new_thread.arg);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -11603,11 +11613,6 @@ thread_insert(th)
|
|||
}
|
||||
}
|
||||
|
||||
static struct {
|
||||
rb_thread_t thread;
|
||||
VALUE proc, arg;
|
||||
} new_thread;
|
||||
|
||||
static VALUE
|
||||
rb_thread_start_0(fn, arg, th)
|
||||
VALUE (*fn)();
|
||||
|
@ -11652,6 +11657,8 @@ rb_thread_start_0(fn, arg, th)
|
|||
new_thread.proc = rb_block_proc();
|
||||
new_thread.arg = (VALUE)arg;
|
||||
th->anchor = ip;
|
||||
thread_insert(th);
|
||||
curr_thread = th;
|
||||
longjmp((prot_tag = ip->tag)->buf, TAG_THREAD);
|
||||
}
|
||||
|
||||
|
@ -11747,8 +11754,6 @@ rb_thread_start_1()
|
|||
enum thread_status status;
|
||||
int state;
|
||||
|
||||
thread_insert(th);
|
||||
|
||||
ruby_frame = ip->frame;
|
||||
ruby_block = ip->block;
|
||||
ruby_scope = ip->scope;
|
||||
|
@ -11762,6 +11767,7 @@ rb_thread_start_1()
|
|||
PUSH_TAG(PROT_NONE);
|
||||
if ((state = EXEC_TAG()) == 0) {
|
||||
if (THREAD_SAVE_CONTEXT(th) == 0) {
|
||||
new_thread.thread = 0;
|
||||
curr_thread = th;
|
||||
th->result = rb_block_pass(rb_thread_yield_0, arg, proc);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче