summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
authorko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-01-07 09:47:52 +0000
committerko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-01-07 09:47:52 +0000
commit84f8da11579b8b655505dc8abffc31c715784794 (patch)
treeac14d594c13c1f4de3aa1e79aece9f330d76a10c /process.c
parent4e4eec7016037f051a6d1173bb5829de9c4840c3 (diff)
* thread.c (rb_thread_stop_timer_thread(), rb_thread_reset_timer_thread(),
rb_thread_start_timer_thread()): added. * thread_pthread.ci: add a native_thread_join() and move rb_thread_reset_timer_thread() definition to thread.c. * thread_win32.ci: ditto * process.c: fix before_exec(), after_exec() to stop timer thread (and restart timer thread if exec failed). and fix to reset timer thread information when forked child process starts (to fix [ruby-core:09822]). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r--process.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/process.c b/process.c
index 69002fabde..25f62a6327 100644
--- a/process.c
+++ b/process.c
@@ -891,8 +891,10 @@ proc_detach(VALUE obj, VALUE pid)
char *strtok();
#endif
-#define before_exec() rb_enable_interrupt()
-#define after_exec() rb_disable_interrupt()
+#define before_exec() \
+ (rb_enable_interrupt(), rb_thread_stop_timer_thread())
+#define after_exec() \
+ (rb_thread_start_timer_thread(), rb_disable_interrupt())
extern char *dln_find_exe(const char *fname, const char *path);
@@ -1332,6 +1334,7 @@ rb_fork(int *status, int (*chfunc)(void*), void *charg)
}
}
if (!pid) {
+ rb_thread_reset_timer_thread();
if (chfunc) {
#ifdef FD_CLOEXEC
close(ep[0]);
@@ -1347,7 +1350,7 @@ rb_fork(int *status, int (*chfunc)(void*), void *charg)
_exit(127);
#endif
}
- rb_thread_reset_timer_thread();
+ rb_thread_start_timer_thread();
}
#ifdef FD_CLOEXEC
else if (chfunc) {