summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-27 10:40:57 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-12-27 10:40:57 +0000
commit0a7e7ec7f5c32407cfbd978ffe3d7b04dbe94693 (patch)
treeaaee0a952f495a155ac7fd94e75e81e3d8269d60
parentcca906e87b944c16a0e4030925a2f4f843d9a077 (diff)
downloadruby-0a7e7ec7f5c32407cfbd978ffe3d7b04dbe94693.tar.gz
ruby-0a7e7ec7f5c32407cfbd978ffe3d7b04dbe94693.tar.xz
ruby-0a7e7ec7f5c32407cfbd978ffe3d7b04dbe94693.zip
* process.c (after_exec): needs to reset before restart timer
thread. * thread.c (thread_start_func_2): stops timer thread if forked in the new thread. [ruby-core:19385] git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@21097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog8
-rw-r--r--process.c2
-rw-r--r--thread.c3
3 files changed, 11 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index c9b711f9f..33ee7921f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,10 @@
-Sat Dec 27 19:30:01 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+Sat Dec 27 19:40:56 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
+
+ * process.c (after_exec): needs to reset before restart timer
+ thread.
+
+ * thread.c (thread_start_func_2): stops timer thread if forked in
+ the new thread. [ruby-core:19385]
* thread.c (rb_thread_atfork, rb_thread_atfork_before_exec): DRY.
diff --git a/process.c b/process.c
index 1e8546db0..f965161e2 100644
--- a/process.c
+++ b/process.c
@@ -976,7 +976,7 @@ static int forked_child = 0;
#define before_exec() \
(rb_enable_interrupt(), forked_child ? 0 : rb_thread_stop_timer_thread())
#define after_exec() \
- (rb_thread_start_timer_thread(), forked_child = 0, rb_disable_interrupt())
+ (rb_thread_reset_timer_thread(), rb_thread_start_timer_thread(), forked_child = 0, rb_disable_interrupt())
#define before_fork() before_exec()
#define after_fork() (GET_THREAD()->thrown_errinfo = 0, after_exec())
diff --git a/thread.c b/thread.c
index 0aff67750..3bd89b9bd 100644
--- a/thread.c
+++ b/thread.c
@@ -462,6 +462,9 @@ thread_start_func_2(rb_thread_t *th, VALUE *stack_start, VALUE *register_stack_s
}
}
thread_cleanup_func(th);
+ if (th->vm->main_thread == th) {
+ rb_thread_stop_timer_thread();
+ }
native_mutex_unlock(&th->vm->global_vm_lock);
return 0;