7static bool vm_barrier_finish_p(
rb_vm_t *vm);
17RUBY_ASSERT_vm_locking(
void)
19 if (rb_multi_ractor_p()) {
26RUBY_ASSERT_vm_unlocking(
void)
28 if (rb_multi_ractor_p()) {
38 return vm_locked(GET_VM());
69 if (rb_ractor_status_p(cr, ractor_running)) {
76 VM_ASSERT(rb_ractor_status_p(cr, ractor_blocking));
78 if (vm_barrier_finish_p(vm)) {
207 vm_cond_wait(vm, cond, 0);
213 vm_cond_wait(vm, cond, msec);
217vm_barrier_finish_p(
rb_vm_t *vm)
233 if (!rb_multi_ractor_p()) {
244 VM_ASSERT(rb_ractor_status_p(cr, ractor_running));
257 list_for_each(&vm->
ractor.
set, r, vmlr_node) {
264 while (!vm_barrier_finish_p(vm)) {
275 list_for_each(&vm->
ractor.
set, r, vmlr_node) {
283 unsigned int recorded_lock_rec,
284 unsigned int current_lock_rec)
286 VM_ASSERT(recorded_lock_rec != current_lock_rec);
288 if (
UNLIKELY(recorded_lock_rec > current_lock_rec)) {
289 rb_bug(
"unexpected situation - recordd:%u current:%u",
290 recorded_lock_rec, current_lock_rec);
293 while (recorded_lock_rec < current_lock_rec) {
298 VM_ASSERT(recorded_lock_rec == rb_ec_vm_lock_rec(ec));
#define RB_DEBUG_COUNTER_INC(type)
#define MJIT_FUNC_EXPORTED
#define RB_GC_SAVE_MACHINE_CONTEXT(th)
void rb_bug(const char *fmt,...)
void rb_vm_ractor_blocking_cnt_dec(rb_vm_t *vm, rb_ractor_t *cr, const char *file, int line)
void rb_ractor_vm_barrier_interrupt_running_thread(rb_ractor_t *r)
void rb_vm_ractor_blocking_cnt_inc(rb_vm_t *vm, rb_ractor_t *cr, const char *file, int line)
rb_nativethread_cond_t barrier_wait_cond
struct rb_ractor_sync sync
struct rb_vm_struct::@194::@197 sync
rb_nativethread_cond_t barrier_cond
struct rb_vm_struct::@194 ractor
rb_nativethread_lock_t lock
unsigned int blocking_cnt
struct rb_ractor_struct * lock_owner
void rb_native_mutex_lock(rb_nativethread_lock_t *lock)
void rb_native_mutex_unlock(rb_nativethread_lock_t *lock)
void rb_native_cond_signal(rb_nativethread_cond_t *cond)
void rb_native_cond_wait(rb_nativethread_cond_t *cond, rb_nativethread_lock_t *mutex)
void rb_native_cond_timedwait(rb_nativethread_cond_t *cond, rb_nativethread_lock_t *mutex, unsigned long msec)
#define RUBY_DEBUG_LOG2(file, line, fmt,...)
#define RUBY_DEBUG_LOG(fmt,...)
void rb_vm_unlock_body(LOCATION_ARGS)
void rb_vm_lock_enter_body(unsigned int *lev APPEND_LOCATION_ARGS)
void rb_vm_cond_wait(rb_vm_t *vm, rb_nativethread_cond_t *cond)
void rb_vm_lock_enter_body_nb(unsigned int *lev APPEND_LOCATION_ARGS)
void rb_vm_lock_leave_body(unsigned int *lev APPEND_LOCATION_ARGS)
void rb_vm_lock_enter_body_cr(rb_ractor_t *cr, unsigned int *lev APPEND_LOCATION_ARGS)
void rb_vm_cond_timedwait(rb_vm_t *vm, rb_nativethread_cond_t *cond, unsigned long msec)
bool rb_vm_locked_p(void)
void rb_vm_lock_body(LOCATION_ARGS)
void rb_ec_vm_lock_rec_release(const rb_execution_context_t *ec, unsigned int recorded_lock_rec, unsigned int current_lock_rec)
#define ASSERT_vm_locking()
#define APPEND_LOCATION_PARAMS
#define ASSERT_vm_unlocking()
#define RB_VM_LOCK_LEAVE_LEV(levp)
#define APPEND_LOCATION_ARGS