Rename RB_GC_SAVE_MACHINE_CONTEXT -> RB_VM_SAVE_MACHINE_CONTEXT
This commit is contained in:
parent
5791aa6263
commit
60b8c7d9fd
Notes:
git
2023-03-15 21:26:49 +00:00
6
thread.c
6
thread.c
@ -173,7 +173,7 @@ static inline void blocking_region_end(rb_thread_t *th, struct rb_blocking_regio
|
|||||||
|
|
||||||
#define THREAD_BLOCKING_BEGIN(th) do { \
|
#define THREAD_BLOCKING_BEGIN(th) do { \
|
||||||
struct rb_thread_sched * const sched = TH_SCHED(th); \
|
struct rb_thread_sched * const sched = TH_SCHED(th); \
|
||||||
RB_GC_SAVE_MACHINE_CONTEXT(th); \
|
RB_VM_SAVE_MACHINE_CONTEXT(th); \
|
||||||
thread_sched_to_waiting(sched);
|
thread_sched_to_waiting(sched);
|
||||||
|
|
||||||
#define THREAD_BLOCKING_END(th) \
|
#define THREAD_BLOCKING_END(th) \
|
||||||
@ -1439,7 +1439,7 @@ rb_thread_schedule_limits(uint32_t limits_us)
|
|||||||
if (th->running_time_us >= limits_us) {
|
if (th->running_time_us >= limits_us) {
|
||||||
RUBY_DEBUG_LOG("switch %s", "start");
|
RUBY_DEBUG_LOG("switch %s", "start");
|
||||||
|
|
||||||
RB_GC_SAVE_MACHINE_CONTEXT(th);
|
RB_VM_SAVE_MACHINE_CONTEXT(th);
|
||||||
thread_sched_yield(TH_SCHED(th), th);
|
thread_sched_yield(TH_SCHED(th), th);
|
||||||
rb_ractor_thread_switch(th->ractor, th);
|
rb_ractor_thread_switch(th->ractor, th);
|
||||||
|
|
||||||
@ -1474,7 +1474,7 @@ blocking_region_begin(rb_thread_t *th, struct rb_blocking_region_buffer *region,
|
|||||||
|
|
||||||
RUBY_DEBUG_LOG("");
|
RUBY_DEBUG_LOG("");
|
||||||
|
|
||||||
RB_GC_SAVE_MACHINE_CONTEXT(th);
|
RB_VM_SAVE_MACHINE_CONTEXT(th);
|
||||||
thread_sched_to_waiting(TH_SCHED(th));
|
thread_sched_to_waiting(TH_SCHED(th));
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -2282,7 +2282,7 @@ ubf_ppoll_sleep(void *ignore)
|
|||||||
#define THREAD_BLOCKING_YIELD(th) do { \
|
#define THREAD_BLOCKING_YIELD(th) do { \
|
||||||
const rb_thread_t *next; \
|
const rb_thread_t *next; \
|
||||||
struct rb_thread_sched *sched = TH_SCHED(th); \
|
struct rb_thread_sched *sched = TH_SCHED(th); \
|
||||||
RB_GC_SAVE_MACHINE_CONTEXT(th); \
|
RB_VM_SAVE_MACHINE_CONTEXT(th); \
|
||||||
rb_native_mutex_lock(&sched->lock); \
|
rb_native_mutex_lock(&sched->lock); \
|
||||||
next = thread_sched_to_waiting_common(sched); \
|
next = thread_sched_to_waiting_common(sched); \
|
||||||
rb_native_mutex_unlock(&sched->lock); \
|
rb_native_mutex_unlock(&sched->lock); \
|
||||||
|
@ -1819,7 +1819,7 @@ RUBY_EXTERN unsigned int ruby_vm_event_local_num;
|
|||||||
#define GET_THREAD() rb_current_thread()
|
#define GET_THREAD() rb_current_thread()
|
||||||
#define GET_EC() rb_current_execution_context(true)
|
#define GET_EC() rb_current_execution_context(true)
|
||||||
|
|
||||||
#define RB_GC_SAVE_MACHINE_CONTEXT(th) \
|
#define RB_VM_SAVE_MACHINE_CONTEXT(th) \
|
||||||
do { \
|
do { \
|
||||||
FLUSH_REGISTER_WINDOWS; \
|
FLUSH_REGISTER_WINDOWS; \
|
||||||
setjmp((th)->ec->machine.regs); \
|
setjmp((th)->ec->machine.regs); \
|
||||||
|
@ -64,7 +64,7 @@ vm_lock_enter(rb_ractor_t *cr, rb_vm_t *vm, bool locked, bool no_barrier, unsign
|
|||||||
rb_thread_t *th = GET_THREAD();
|
rb_thread_t *th = GET_THREAD();
|
||||||
bool running;
|
bool running;
|
||||||
|
|
||||||
RB_GC_SAVE_MACHINE_CONTEXT(th);
|
RB_VM_SAVE_MACHINE_CONTEXT(th);
|
||||||
|
|
||||||
if (rb_ractor_status_p(cr, ractor_running)) {
|
if (rb_ractor_status_p(cr, ractor_running)) {
|
||||||
rb_vm_ractor_blocking_cnt_inc(vm, cr, __FILE__, __LINE__);
|
rb_vm_ractor_blocking_cnt_inc(vm, cr, __FILE__, __LINE__);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user