summaryrefslogtreecommitdiffstats
path: root/thread.c
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-06 13:21:26 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-11-06 13:21:26 +0000
commit904eebcc60c183371f26d483b10ba10762dafe5c (patch)
treeef86e9d50be835d6ddb8b32c546b1ca7baabc9ef /thread.c
parent5cae0ce6a5556a0bd397d13de9127e22cd3480c8 (diff)
downloadruby-904eebcc60c183371f26d483b10ba10762dafe5c.tar.gz
ruby-904eebcc60c183371f26d483b10ba10762dafe5c.tar.xz
ruby-904eebcc60c183371f26d483b10ba10762dafe5c.zip
* thread.c (rb_thread_stop_timer_thread): terminates timer thread
immediately. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@20117 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/thread.c b/thread.c
index 7e4e280f0..ca4741964 100644
--- a/thread.c
+++ b/thread.c
@@ -71,10 +71,10 @@ static void rb_check_deadlock(rb_vm_t *vm);
void rb_signal_exec(rb_thread_t *th, int sig);
void rb_disable_interrupt(void);
+void rb_thread_stop_timer_thread(void);
static const VALUE eKillSignal = INT2FIX(0);
static const VALUE eTerminateSignal = INT2FIX(1);
-static volatile int system_working = 1;
inline static void
st_delete_wrap(st_table *table, st_data_t key)
@@ -318,7 +318,7 @@ rb_thread_terminate_all(void)
}
POP_TAG();
}
- system_working = 0;
+ rb_thread_stop_timer_thread();
}
static void
@@ -2322,7 +2322,7 @@ int rb_get_next_signal(void);
static void
timer_thread_function(void *arg)
{
- rb_vm_t *vm = arg; /* TODO: fix me for Multi-VM */
+ rb_vm_t *vm = GET_VM(); /* TODO: fix me for Multi-VM */
int sig;
/* for time slice */
@@ -2356,7 +2356,7 @@ void
rb_thread_stop_timer_thread(void)
{
if (timer_thread_id) {
- system_working = 0;
+ native_stop_timer_thread();
native_thread_join(timer_thread_id);
timer_thread_id = 0;
}