From bcfc22b10e30771e692f7716a1fec7577373963e Mon Sep 17 00:00:00 2001 From: kosaki Date: Mon, 13 Jun 2011 14:14:53 +0000 Subject: * thread_pthread.c: rewrite GVL completely. * thread_win32.c: ditto. * thread_pthread.h: ditto. * vm_core.h: ditto. * thread.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32064 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- vm_core.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'vm_core.h') diff --git a/vm_core.h b/vm_core.h index 4d1780f303..98ec9b4c51 100644 --- a/vm_core.h +++ b/vm_core.h @@ -419,7 +419,6 @@ typedef struct rb_thread_struct { rb_thread_id_t thread_id; enum rb_thread_status status; int priority; - int slice; native_thread_data_t native_thread_data; void *blocking_region_buffer; @@ -484,6 +483,7 @@ typedef struct rb_thread_struct { #ifdef USE_SIGALTSTACK void *altstack; #endif + unsigned long running_time_us; } rb_thread_t; /* iseq.c */ @@ -673,6 +673,9 @@ extern rb_vm_t *ruby_current_vm; #define GET_THREAD() ruby_current_thread #define rb_thread_set_current_raw(th) (void)(ruby_current_thread = (th)) #define rb_thread_set_current(th) do { \ + if ((th)->vm->running_thread != (th)) { \ + (th)->vm->running_thread->running_time_us = 0; \ + } \ rb_thread_set_current_raw(th); \ (th)->vm->running_thread = (th); \ } while (0) -- cgit v1.2.3