mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* thread.c (thread_create_core): set thread group before creating
thread. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15115 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
956666cf5a
commit
3882b07c3a
3 changed files with 13 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Fri Jan 18 23:49:41 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* thread.c (thread_create_core): set thread group before creating
|
||||||
|
thread.
|
||||||
|
|
||||||
Fri Jan 18 20:19:51 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
Fri Jan 18 20:19:51 2008 NAKAMURA Usaku <usa@ruby-lang.org>
|
||||||
|
|
||||||
* parse.y (ripper_initialize): too early to set parser->enc.
|
* parse.y (ripper_initialize): too early to set parser->enc.
|
||||||
|
|
|
@ -160,6 +160,13 @@ assert_equal %q{[1, 1]}, %q{
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
[thg.list.size, ThreadGroup::Default.list.size]
|
[thg.list.size, ThreadGroup::Default.list.size]
|
||||||
}
|
}
|
||||||
|
assert_equal %q{true}, %q{
|
||||||
|
thg = ThreadGroup.new
|
||||||
|
|
||||||
|
t = Thread.new{sleep 5}
|
||||||
|
thg.add t
|
||||||
|
thg.list.include?(t)
|
||||||
|
}
|
||||||
assert_equal %q{[true, nil, true]}, %q{
|
assert_equal %q{[true, nil, true]}, %q{
|
||||||
/a/ =~ 'a'
|
/a/ =~ 'a'
|
||||||
$a = $~
|
$a = $~
|
||||||
|
|
2
thread.c
2
thread.c
|
@ -302,7 +302,6 @@ thread_start_func_2(rb_thread_t *th, VALUE *stack_start, VALUE *register_stack_s
|
||||||
#ifdef __ia64
|
#ifdef __ia64
|
||||||
th->machine_register_stack_start = register_stack_start;
|
th->machine_register_stack_start = register_stack_start;
|
||||||
#endif
|
#endif
|
||||||
th->thgroup = th->vm->thgroup_default;
|
|
||||||
thread_debug("thread start: %p\n", th);
|
thread_debug("thread start: %p\n", th);
|
||||||
|
|
||||||
native_mutex_lock(&th->vm->global_interpreter_lock);
|
native_mutex_lock(&th->vm->global_interpreter_lock);
|
||||||
|
@ -383,6 +382,7 @@ thread_create_core(VALUE thval, VALUE args, VALUE (*fn)(ANYARGS))
|
||||||
th->first_func = fn;
|
th->first_func = fn;
|
||||||
|
|
||||||
th->priority = GET_THREAD()->priority;
|
th->priority = GET_THREAD()->priority;
|
||||||
|
th->thgroup = th->vm->thgroup_default;
|
||||||
|
|
||||||
native_mutex_initialize(&th->interrupt_lock);
|
native_mutex_initialize(&th->interrupt_lock);
|
||||||
/* kick thread */
|
/* kick thread */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue