ruby-changes:3626
From: ko1@a...
Date: Fri, 18 Jan 2008 23:50:08 +0900 (JST)
Subject: [ruby-changes:3626] nobu - Ruby:r15115 (trunk): * thread.c (thread_create_core): set thread group before creating
nobu 2008-01-18 23:49:43 +0900 (Fri, 18 Jan 2008) New Revision: 15115 Modified files: trunk/ChangeLog trunk/bootstraptest/test_thread.rb trunk/thread.c Log: * thread.c (thread_create_core): set thread group before creating thread. http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/ChangeLog?r1=15115&r2=15114&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/thread.c?r1=15115&r2=15114&diff_format=u http://svn.ruby-lang.org/cgi-bin/viewvc.cgi/trunk/bootstraptest/test_thread.rb?r1=15115&r2=15114&diff_format=u Index: ChangeLog =================================================================== --- ChangeLog (revision 15114) +++ ChangeLog (revision 15115) @@ -1,3 +1,8 @@ +Fri Jan 18 23:49:41 2008 Nobuyoshi Nakada <nobu@r...> + + * thread.c (thread_create_core): set thread group before creating + thread. + Fri Jan 18 20:19:51 2008 NAKAMURA Usaku <usa@r...> * parse.y (ripper_initialize): too early to set parser->enc. Index: bootstraptest/test_thread.rb =================================================================== --- bootstraptest/test_thread.rb (revision 15114) +++ bootstraptest/test_thread.rb (revision 15115) @@ -160,6 +160,13 @@ sleep 0.1 [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{ /a/ =~ 'a' $a = $~ Index: thread.c =================================================================== --- thread.c (revision 15114) +++ thread.c (revision 15115) @@ -302,7 +302,6 @@ #ifdef __ia64 th->machine_register_stack_start = register_stack_start; #endif - th->thgroup = th->vm->thgroup_default; thread_debug("thread start: %p\n", th); native_mutex_lock(&th->vm->global_interpreter_lock); @@ -383,6 +382,7 @@ th->first_func = fn; th->priority = GET_THREAD()->priority; + th->thgroup = th->vm->thgroup_default; native_mutex_initialize(&th->interrupt_lock); /* kick thread */ -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/