* thread.c (rb_thread_atfork): fix to mark thread object.
[ruby-dev:32404] * bootstraptest/test_knownbug.rb, test_fork.rb: move a fixed test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@14420 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
5c00dd28c5
commit
6cbc9ac208
@ -1,3 +1,10 @@
|
|||||||
|
Fri Dec 21 17:25:22 2007 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
|
* thread.c (rb_thread_atfork): fix to mark thread object.
|
||||||
|
[ruby-dev:32404]
|
||||||
|
|
||||||
|
* bootstraptest/test_knownbug.rb, test_fork.rb: move a fixed test.
|
||||||
|
|
||||||
Fri Dec 21 17:07:13 2007 Koichi Sasada <ko1@atdot.net>
|
Fri Dec 21 17:07:13 2007 Koichi Sasada <ko1@atdot.net>
|
||||||
|
|
||||||
* gc.h: extern variable should not be initialized.
|
* gc.h: extern variable should not be initialized.
|
||||||
|
6
bootstraptest/test_fork.rb
Normal file
6
bootstraptest/test_fork.rb
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
assert_equal '0', %q{
|
||||||
|
GC.stress = true
|
||||||
|
pid = fork {}
|
||||||
|
Process.wait pid
|
||||||
|
$?.to_i
|
||||||
|
}, '[ruby-dev:32404]'
|
@ -3,13 +3,6 @@
|
|||||||
# So all tests will cause failure.
|
# So all tests will cause failure.
|
||||||
#
|
#
|
||||||
|
|
||||||
assert_equal '0', %q{
|
|
||||||
GC.stress = true
|
|
||||||
pid = fork {}
|
|
||||||
Process.wait pid
|
|
||||||
$?.to_i
|
|
||||||
}, '[ruby-dev:32404]'
|
|
||||||
|
|
||||||
assert_equal 'ok', %q{
|
assert_equal 'ok', %q{
|
||||||
1.times{
|
1.times{
|
||||||
eval("break")
|
eval("break")
|
||||||
|
3
thread.c
3
thread.c
@ -1974,11 +1974,12 @@ rb_thread_atfork(void)
|
|||||||
{
|
{
|
||||||
rb_thread_t *th = GET_THREAD();
|
rb_thread_t *th = GET_THREAD();
|
||||||
rb_vm_t *vm = th->vm;
|
rb_vm_t *vm = th->vm;
|
||||||
|
volatile VALUE thval = th->self;
|
||||||
vm->main_thread = th;
|
vm->main_thread = th;
|
||||||
|
|
||||||
st_free_table(vm->living_threads);
|
st_free_table(vm->living_threads);
|
||||||
vm->living_threads = st_init_numtable();
|
vm->living_threads = st_init_numtable();
|
||||||
st_insert(vm->living_threads, th->self, (st_data_t) th->thread_id);
|
st_insert(vm->living_threads, thval, (st_data_t) th->thread_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
struct thgroup {
|
struct thgroup {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user