1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* 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
This commit is contained in:
ko1 2007-01-07 09:47:52 +00:00
parent 4e4eec7016
commit 84f8da1157
5 changed files with 61 additions and 22 deletions

View file

@ -65,7 +65,7 @@ NOINLINE(void yarv_set_stack_end(VALUE **stack_end_p));
static VALUE eKillSignal = INT2FIX(0);
static VALUE eTerminateSignal = INT2FIX(1);
static int system_working = 1;
static volatile int system_working = 1;
inline static void
st_delete_wrap(st_table * table, VALUE key)
@ -1602,6 +1602,27 @@ timer_thread_function(void)
}
}
void
rb_thread_stop_timer_thread(void)
{
if (timer_thread_id) {
system_working = 0;
native_thread_join(timer_thread_id);
}
}
void
rb_thread_reset_timer_thread(void)
{
timer_thread_id = 0;
}
void
rb_thread_start_timer_thread(void)
{
rb_thread_create_timer_thread();
}
/***/
void