From 6cbc9ac208b5bbaf5d43cdd47268f41d6a98970b Mon Sep 17 00:00:00 2001 From: ko1 Date: Fri, 21 Dec 2007 08:27:14 +0000 Subject: * 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 --- ChangeLog | 7 +++++++ bootstraptest/test_fork.rb | 6 ++++++ bootstraptest/test_knownbug.rb | 7 ------- thread.c | 3 ++- 4 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 bootstraptest/test_fork.rb diff --git a/ChangeLog b/ChangeLog index 2343db1ddc..3c5ba875c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +Fri Dec 21 17:25:22 2007 Koichi Sasada + + * 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 * gc.h: extern variable should not be initialized. diff --git a/bootstraptest/test_fork.rb b/bootstraptest/test_fork.rb new file mode 100644 index 0000000000..4632ca2694 --- /dev/null +++ b/bootstraptest/test_fork.rb @@ -0,0 +1,6 @@ +assert_equal '0', %q{ + GC.stress = true + pid = fork {} + Process.wait pid + $?.to_i +}, '[ruby-dev:32404]' diff --git a/bootstraptest/test_knownbug.rb b/bootstraptest/test_knownbug.rb index d52d86e6dc..8b53798c28 100644 --- a/bootstraptest/test_knownbug.rb +++ b/bootstraptest/test_knownbug.rb @@ -3,13 +3,6 @@ # 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{ 1.times{ eval("break") diff --git a/thread.c b/thread.c index 936360d5b6..d4916016c5 100644 --- a/thread.c +++ b/thread.c @@ -1974,11 +1974,12 @@ rb_thread_atfork(void) { rb_thread_t *th = GET_THREAD(); rb_vm_t *vm = th->vm; + volatile VALUE thval = th->self; vm->main_thread = th; st_free_table(vm->living_threads); 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 { -- cgit v1.2.3