aboutsummaryrefslogtreecommitdiffstats
path: root/thread.c
diff options
context:
space:
mode:
Diffstat (limited to 'thread.c')
-rw-r--r--thread.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/thread.c b/thread.c
index 5e0c92d44f..d5dd8ae895 100644
--- a/thread.c
+++ b/thread.c
@@ -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