mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
fix decl of ruby_single_main_ractor
On windows, MJIT doesn't work without this patch because of the declaration of ruby_single_main_ractor. This patch fix this issue and move the definition of it from ractor.c to vm.c to locate near place of ruby_current_vm_ptr.
This commit is contained in:
parent
344ec26a99
commit
bef3eb5440
Notes:
git
2020-12-07 08:29:07 +09:00
4 changed files with 3 additions and 10 deletions
7
ractor.c
7
ractor.c
|
@ -30,13 +30,6 @@ rb_ractor_error_class(void)
|
|||
return rb_eRactorError;
|
||||
}
|
||||
|
||||
RUBY_SYMBOL_EXPORT_BEGIN
|
||||
|
||||
// to share with MJIT
|
||||
rb_ractor_t *ruby_single_main_ractor;
|
||||
|
||||
RUBY_SYMBOL_EXPORT_END
|
||||
|
||||
static void vm_ractor_blocking_cnt_inc(rb_vm_t *vm, rb_ractor_t *r, const char *file, int line);
|
||||
|
||||
static void
|
||||
|
|
1
vm.c
1
vm.c
|
@ -378,6 +378,7 @@ VALUE rb_block_param_proxy;
|
|||
#define ruby_vm_redefined_flag GET_VM()->redefined_flag
|
||||
VALUE ruby_vm_const_missing_count = 0;
|
||||
rb_vm_t *ruby_current_vm_ptr = NULL;
|
||||
rb_ractor_t *ruby_single_main_ractor;
|
||||
|
||||
#ifdef RB_THREAD_LOCAL_SPECIFIER
|
||||
RB_THREAD_LOCAL_SPECIFIER rb_execution_context_t *ruby_current_ec;
|
||||
|
|
|
@ -1733,6 +1733,7 @@ rb_execution_context_t *rb_vm_main_ractor_ec(rb_vm_t *vm); // ractor.c
|
|||
#if RUBY_VM_THREAD_MODEL == 2
|
||||
RUBY_SYMBOL_EXPORT_BEGIN
|
||||
|
||||
RUBY_EXTERN struct rb_ractor_struct *ruby_single_main_ractor; // ractor.c
|
||||
RUBY_EXTERN rb_vm_t *ruby_current_vm_ptr;
|
||||
RUBY_EXTERN rb_event_flag_t ruby_vm_event_flags;
|
||||
RUBY_EXTERN rb_event_flag_t ruby_vm_event_enabled_global_flags;
|
||||
|
@ -1799,8 +1800,6 @@ rb_current_thread(void)
|
|||
return rb_ec_thread_ptr(ec);
|
||||
}
|
||||
|
||||
extern struct rb_ractor_struct *ruby_single_main_ractor; // ractor.c
|
||||
|
||||
static inline rb_ractor_t *
|
||||
rb_current_ractor(void)
|
||||
{
|
||||
|
|
|
@ -31,7 +31,7 @@ void rb_vm_barrier(void);
|
|||
#include "vm_core.h"
|
||||
#endif
|
||||
|
||||
extern struct rb_ractor_struct *ruby_single_main_ractor; // ractor.c
|
||||
RUBY_EXTERN struct rb_ractor_struct *ruby_single_main_ractor; // ractor.c
|
||||
|
||||
static inline bool
|
||||
rb_multi_ractor_p(void)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue