summaryrefslogtreecommitdiff
path: root/thread_win32.ci
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 /thread_win32.ci
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 'thread_win32.ci')
-rw-r--r--thread_win32.ci19
1 files changed, 9 insertions, 10 deletions
diff --git a/thread_win32.ci b/thread_win32.ci
index 27550ccf01..2d1cddea18 100644
--- a/thread_win32.ci
+++ b/thread_win32.ci
@@ -260,6 +260,12 @@ native_thread_create(yarv_thread_t *th)
}
static void
+native_thread_join(HANDLE th)
+{
+ w32_wait_event(th, 0, 0);
+}
+
+static void
native_thread_apply_priority(yarv_thread_t *th)
{
int priority = th->priority;
@@ -285,7 +291,7 @@ native_thread_interrupt(yarv_thread_t *th)
static void timer_thread_function(void);
-static HANDLE timer_thread_handle = 0;
+static HANDLE timer_thread_id = 0;
static unsigned int _stdcall
timer_thread_func(void *dummy)
@@ -302,16 +308,9 @@ timer_thread_func(void *dummy)
void
rb_thread_create_timer_thread(void)
{
- if (timer_thread_handle == 0) {
- timer_thread_handle = w32_create_thread(1024, timer_thread_func, 0);
+ if (timer_thread_id == 0) {
+ timer_thread_id = w32_create_thread(1024, timer_thread_func, 0);
}
}
-void
-rb_thread_reset_timer_thread(void)
-{
- timer_thread_handle = 0;
- rb_thread_create_timer_thread();
-}
-
#endif /* THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION */