summaryrefslogtreecommitdiff
path: root/vm_core.h
diff options
context:
space:
mode:
authorkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-13 14:14:53 +0000
committerkosaki <kosaki@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-06-13 14:14:53 +0000
commitbcfc22b10e30771e692f7716a1fec7577373963e (patch)
tree5e8442fc328f3e322069070a678141837e1e9c9b /vm_core.h
parente504a81ff11c8611f06d54a23b355fed90b356ab (diff)
* 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
Diffstat (limited to 'vm_core.h')
-rw-r--r--vm_core.h5
1 files changed, 4 insertions, 1 deletions
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)