diff options
| author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-01-07 09:47:52 +0000 |
|---|---|---|
| committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2007-01-07 09:47:52 +0000 |
| commit | dc8972b05ede0a3cb191397b1dc709f181c73cb3 (patch) | |
| tree | ac14d594c13c1f4de3aa1e79aece9f330d76a10c /process.c | |
| parent | c189c5789f2709c435ee8dc6c57b148dfe471a72 (diff) | |
| download | ruby-dc8972b05ede0a3cb191397b1dc709f181c73cb3.tar.gz ruby-dc8972b05ede0a3cb191397b1dc709f181c73cb3.tar.xz ruby-dc8972b05ede0a3cb191397b1dc709f181c73cb3.zip | |
* 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: http://svn.ruby-lang.org/repos/ruby/trunk@11509 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
| -rw-r--r-- | process.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -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) { |
