summaryrefslogtreecommitdiff
path: root/thread_win32.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-08 15:31:05 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-08 15:31:05 +0000
commit641f43de973d51a7d463b067833d4a71706d6c5c (patch)
tree555a72d40d2a2645020a675fc085b716dd097f2b /thread_win32.c
parentb2390fb1cc3f38ca4516394034c8680eeb01a64c (diff)
* thread_pthread.c (thread_timer): checks working flags again.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20160 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread_win32.c')
-rw-r--r--thread_win32.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/thread_win32.c b/thread_win32.c
index feba5ec..0befbff 100644
--- a/thread_win32.c
+++ b/thread_win32.c
@@ -558,6 +558,15 @@ rb_thread_create_timer_thread(void)
}
}
-#define native_stop_timer_thread() (CloseHandle(timer_thread_lock), timer_thread_lock = 0)
+static int
+native_stop_timer_thread(void)
+{
+ int stopped = --system_working <= 0;
+ if (stopped) {
+ CloseHandle(timer_thread_lock);
+ timer_thread_lock = 0;
+ }
+ return stopped;
+}
#endif /* THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION */