summaryrefslogtreecommitdiff
path: root/vm_core.h
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-13 21:34:20 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-13 21:34:20 +0000
commit48b6bd74e2febde095ac85d818e94c0e58677647 (patch)
tree73348a2cf6a66b1f1d6620b93109b7f7dfb0ca03 /vm_core.h
parent4d2e0fffb08f0418fa6995be2e15aad7ee11b048 (diff)
thread_pthread.c: eliminate timer thread by restructuring GVL
This reverts commit 194a6a2c68e9c8a3536b24db18ceac87535a6051 (r64203). Race conditions which caused the original reversion will be fixed in the subsequent commit. [ruby-core:88360] [Misc #14937] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_core.h')
-rw-r--r--vm_core.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/vm_core.h b/vm_core.h
index 88b3ccb..4fb6e07 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -564,10 +564,12 @@ typedef struct rb_vm_struct {
VALUE self;
rb_global_vm_lock_t gvl;
- rb_nativethread_lock_t thread_destruct_lock;
struct rb_thread_struct *main_thread;
- struct rb_thread_struct *running_thread;
+
+ /* persists across uncontended GVL release/acquire for time slice */
+ const struct rb_thread_struct *running_thread;
+
#ifdef USE_SIGALTSTACK
void *main_altstack;
#endif
@@ -1583,7 +1585,7 @@ void rb_vm_pop_frame(rb_execution_context_t *ec);
void rb_thread_start_timer_thread(void);
void rb_thread_stop_timer_thread(void);
void rb_thread_reset_timer_thread(void);
-void rb_thread_wakeup_timer_thread(void);
+void rb_thread_wakeup_timer_thread(int);
static inline void
rb_vm_living_threads_init(rb_vm_t *vm)