Ruby: ractor.c File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Data Structures | Macros | Typedefs | Enumerations | Functions | Variables
ractor.c File Reference
`#include "ruby/ruby.h"`
`#include "ruby/thread.h"`
`#include "ruby/ractor.h"`
`#include "ruby/thread_native.h"`
`#include "vm_core.h"`
`#include "vm_sync.h"`
`#include "ractor_core.h"`
`#include "internal/complex.h"`
`#include "internal/error.h"`
`#include "internal/hash.h"`
`#include "internal/rational.h"`
`#include "internal/struct.h"`
`#include "internal/thread.h"`
`#include "variable.h"`
`#include "gc.h"`
`#include "transient_heap.h"`
`#include "ractor.rbinc"`

Go to the source code of this file.

## Data Structures
struct | receive_block_data
struct | obj_traverse_data
struct | obj_traverse_callback_data
struct | rb_obj_traverse_final_data
struct | obj_traverse_replace_data
struct | obj_traverse_replace_callback_data
struct | RVALUE
struct | rb_ractor_local_key_struct
struct | freed_ractor_local_keys_struct

## Macros
#define | RACTOR_LOCK(r) ractor_lock(r, __FILE__, __LINE__)
#define | RACTOR_UNLOCK(r) ractor_unlock(r, __FILE__, __LINE__)
#define | RACTOR_LOCK_SELF(r) ractor_lock_self(r, __FILE__, __LINE__)
#define | RACTOR_UNLOCK_SELF(r) ractor_unlock_self(r, __FILE__, __LINE__)
#define | CHECK_AND_REPLACE(v)
#define | DEFAULT_KEYS_CAPA 0x10

## Typedefs
typedef enum obj_traverse_iterator_result(* | rb_obj_traverse_enter_func) (VALUE obj)
typedef enum obj_traverse_iterator_result(* | rb_obj_traverse_leave_func) (VALUE obj)
typedef enum obj_traverse_iterator_result(* | rb_obj_traverse_final_func) (VALUE obj)
typedef enum obj_traverse_iterator_result(* | rb_obj_traverse_replace_enter_func) (VALUE obj, struct obj_traverse_replace_data *data)
typedef enum obj_traverse_iterator_result(* | rb_obj_traverse_replace_leave_func) (VALUE obj, struct obj_traverse_replace_data *data)

## Enumerations
enum | obj_traverse_iterator_result { traverse_cont , traverse_skip , traverse_stop }
| traverse function More...

## Functions
bool | rb_ractor_p (VALUE gv)
rb_ractor_t * | rb_ractor_main_alloc (void)
void | rb_gvl_init (rb_global_vm_lock_t *gvl)
void | rb_ractor_living_threads_init (rb_ractor_t *r)
void | rb_ractor_main_setup (rb_vm_t *vm, rb_ractor_t *r, rb_thread_t *th)
void | rb_ractor_teardown (rb_execution_context_t *ec)
void | rb_ractor_atexit (rb_execution_context_t *ec, VALUE result)
void | rb_ractor_atexit_exception (rb_execution_context_t *ec)
void | rb_ractor_receive_parameters (rb_execution_context_t *ec, rb_ractor_t *r, int len, VALUE *ptr)
void | rb_ractor_send_parameters (rb_execution_context_t *ec, rb_ractor_t *r, VALUE args)
bool | rb_ractor_main_p_ (void)
bool | rb_obj_is_main_ractor (VALUE gv)
rb_global_vm_lock_t * | rb_ractor_gvl (rb_ractor_t *r)
int | rb_ractor_living_thread_num (const rb_ractor_t *r)
VALUE | rb_ractor_thread_list (rb_ractor_t *r)
void | rb_ractor_living_threads_insert (rb_ractor_t *r, rb_thread_t *th)
void | rb_vm_ractor_blocking_cnt_inc (rb_vm_t *vm, rb_ractor_t *cr, const char *file, int line)
void | rb_vm_ractor_blocking_cnt_dec (rb_vm_t *vm, rb_ractor_t *cr, const char *file, int line)
void | rb_ractor_living_threads_remove (rb_ractor_t *cr, rb_thread_t *th)
void | rb_ractor_blocking_threads_inc (rb_ractor_t *cr, const char *file, int line)
void | rb_ractor_blocking_threads_dec (rb_ractor_t *cr, const char *file, int line)
void | rb_ractor_vm_barrier_interrupt_running_thread (rb_ractor_t *r)
void | rb_ractor_terminate_interrupt_main_thread (rb_ractor_t *r)
void | rb_thread_terminate_all (rb_thread_t *th)
void | rb_ractor_terminate_all (void)
rb_execution_context_t * | rb_vm_main_ractor_ec (rb_vm_t *vm)
void | Init_Ractor (void)
void | rb_ractor_dump (void)
VALUE | rb_ractor_stdin (void)
VALUE | rb_ractor_stdout (void)
VALUE | rb_ractor_stderr (void)
void | rb_ractor_stdin_set (VALUE in)
void | rb_ractor_stdout_set (VALUE out)
void | rb_ractor_stderr_set (VALUE err)
rb_hook_list_t * | rb_ractor_hooks (rb_ractor_t *cr)
VALUE | rb_ractor_make_shareable (VALUE obj)
VALUE | rb_ractor_make_shareable_copy (VALUE obj)
VALUE | rb_ractor_ensure_shareable (VALUE obj, VALUE name)
bool | rb_ractor_shareable_p_continue (VALUE obj)
void | rb_replace_generic_ivar (VALUE clone, VALUE obj)
rb_ractor_local_key_t | rb_ractor_local_storage_ptr_newkey (const struct rb_ractor_local_storage_type *type)
rb_ractor_local_key_t | rb_ractor_local_storage_value_newkey (void)
void | rb_ractor_local_storage_delkey (rb_ractor_local_key_t key)
VALUE | rb_ractor_local_storage_value (rb_ractor_local_key_t key)
bool | rb_ractor_local_storage_value_lookup (rb_ractor_local_key_t key, VALUE *val)
void | rb_ractor_local_storage_value_set (rb_ractor_local_key_t key, VALUE val)
void * | rb_ractor_local_storage_ptr (rb_ractor_local_key_t key)
void | rb_ractor_local_storage_ptr_set (rb_ractor_local_key_t key, void *ptr)
void | rb_ractor_finish_marking (void)

## Variables
VALUE | rb_cRactor
VALUE | rb_eRactorUnsafeError
VALUE | rb_eRactorIsolationError
const struct rb_ractor_local_storage_type | rb_ractor_local_storage_type_free

## Macro Definition Documentation

## ◆ CHECK_AND_REPLACE

#define CHECK_AND_REPLACE | ( |  | v | ) |

Value:
do { \
VALUE _val = (v); \
if (obj_traverse_replace_i(_val, data)) { return 1; } \
else if (data->replacement != _val) { RB_OBJ_WRITE(obj, &v, data->replacement); } \
} while (0)
RB_OBJ_WRITE
#define RB_OBJ_WRITE(a, slot, b)
WB for new reference from ‘a’ to ‘b’.
Definition: rgengc.h:107
VALUE
unsigned long VALUE
Definition: value.h:38

## ◆ DEFAULT_KEYS_CAPA

#define DEFAULT_KEYS_CAPA 0x10

Definition at line 3212 of file ractor.c.

## ◆ RACTOR_LOCK

#define RACTOR_LOCK | ( |  | r | ) | ractor_lock(r, __FILE__, __LINE__)

Definition at line 100 of file ractor.c.

## ◆ RACTOR_LOCK_SELF

#define RACTOR_LOCK_SELF | ( |  | r | ) | ractor_lock_self(r, __FILE__, __LINE__)

Definition at line 102 of file ractor.c.

## ◆ RACTOR_UNLOCK

#define RACTOR_UNLOCK | ( |  | r | ) | ractor_unlock(r, __FILE__, __LINE__)

Definition at line 101 of file ractor.c.

## ◆ RACTOR_UNLOCK_SELF

#define RACTOR_UNLOCK_SELF | ( |  | r | ) | ractor_unlock_self(r, __FILE__, __LINE__)

Definition at line 103 of file ractor.c.

## Typedef Documentation

## ◆ rb_obj_traverse_enter_func

typedef enum obj_traverse_iterator_result(* rb_obj_traverse_enter_func) (VALUE obj)

Definition at line 2196 of file ractor.c.

## ◆ rb_obj_traverse_final_func

typedef enum obj_traverse_iterator_result(* rb_obj_traverse_final_func) (VALUE obj)

Definition at line 2196 of file ractor.c.

## ◆ rb_obj_traverse_leave_func

typedef enum obj_traverse_iterator_result(* rb_obj_traverse_leave_func) (VALUE obj)

Definition at line 2196 of file ractor.c.

## ◆ rb_obj_traverse_replace_enter_func

typedef enum obj_traverse_iterator_result(* rb_obj_traverse_replace_enter_func) (VALUE obj, struct obj_traverse_replace_data *data)

Definition at line 2599 of file ractor.c.

## ◆ rb_obj_traverse_replace_leave_func

typedef enum obj_traverse_iterator_result(* rb_obj_traverse_replace_leave_func) (VALUE obj, struct obj_traverse_replace_data *data)

Definition at line 2599 of file ractor.c.

## Enumeration Type Documentation

## ◆ obj_traverse_iterator_result

enum obj_traverse_iterator_result

traverse function

Enumerator
traverse_cont |
traverse_skip |
traverse_stop |

Definition at line 2207 of file ractor.c.

## Function Documentation

## ◆ Init_Ractor()

void Init_Ractor | ( | void |  | ) |

Definition at line 2083 of file ractor.c.

References rb_cBasicObject, rb_cObject, rb_cRactor, rb_define_class(), rb_define_class_under(), rb_define_method, rb_eRactorIsolationError, rb_eRactorUnsafeError, rb_eRuntimeError, rb_eStopIteration, and rb_undef_alloc_func().

## ◆ rb_gvl_init()

void rb_gvl_init | ( | rb_global_vm_lock_t * | gvl | ) |

## ◆ rb_obj_is_main_ractor()

bool rb_obj_is_main_ractor | ( | VALUE | gv | ) |

Definition at line 1707 of file ractor.c.

References DATA_PTR, and rb_ractor_p().

Referenced by rb_objspace_call_finalizer().

## ◆ rb_ractor_atexit()

void rb_ractor_atexit | ( | rb_execution_context_t * | ec,
|  | VALUE | result
| ) |  |

Definition at line 1668 of file ractor.c.

## ◆ rb_ractor_atexit_exception()

void rb_ractor_atexit_exception | ( | rb_execution_context_t * | ec | ) |

Definition at line 1675 of file ractor.c.

References rb_execution_context_struct::errinfo.

## ◆ rb_ractor_blocking_threads_dec()

void rb_ractor_blocking_threads_dec | ( | rb_ractor_t * | cr,
|  | const char * | file,
|  | int | line
| ) |  |

Definition at line 1870 of file ractor.c.

References rb_ractor_struct::blocking_cnt, rb_ractor_struct::cnt, RB_VM_LOCK_ENTER, RB_VM_LOCK_LEAVE, rb_vm_ractor_blocking_cnt_dec(), RUBY_DEBUG_LOG2, rb_ractor_struct::threads, and VM_ASSERT.

## ◆ rb_ractor_blocking_threads_inc()

void rb_ractor_blocking_threads_inc | ( | rb_ractor_t * | cr,
|  | const char * | file,
|  | int | line
| ) |  |

Definition at line 1858 of file ractor.c.

References rb_ractor_struct::blocking_cnt, rb_ractor_struct::cnt, RUBY_DEBUG_LOG2, rb_ractor_struct::threads, and VM_ASSERT.

## ◆ rb_ractor_dump()

void rb_ractor_dump | ( | void |  | ) |

Definition at line 2111 of file ractor.c.

References rb_ractor_pub::id, rb_vm_struct::main_ractor, rb_ractor_struct::pub, rb_vm_struct::ractor, rb_vm_struct::set, and rb_ractor_struct::status_.

## ◆ rb_ractor_ensure_shareable()

VALUE rb_ractor_ensure_shareable | ( | VALUE | obj,
|  | VALUE | name
| ) |  |

Definition at line 2518 of file ractor.c.

References name, PRIsVALUE, rb_eRactorIsolationError, rb_exc_new_str(), rb_exc_raise(), and rb_sprintf().

## ◆ rb_ractor_finish_marking()

void rb_ractor_finish_marking | ( | void |  | ) |

Definition at line 3215 of file ractor.c.

References DEFAULT_KEYS_CAPA, REALLOC_N, and ruby_xfree().

## ◆ rb_ractor_gvl()

rb_global_vm_lock_t * rb_ractor_gvl | ( | rb_ractor_t * | r | ) |

Definition at line 1715 of file ractor.c.

References rb_ractor_struct::gvl, and rb_ractor_struct::threads.

Referenced by Init_Thread().

## ◆ rb_ractor_hooks()

rb_hook_list_t * rb_ractor_hooks | ( | rb_ractor_t * | cr | ) |

Definition at line 2196 of file ractor.c.

## ◆ rb_ractor_living_thread_num()

int rb_ractor_living_thread_num | ( | const rb_ractor_t * | r | ) |

Definition at line 1721 of file ractor.c.

References rb_ractor_struct::cnt, and rb_ractor_struct::threads.

Referenced by rb_nogvl(), rb_thread_alone(), and rb_thread_terminate_all().

## ◆ rb_ractor_living_threads_init()

void rb_ractor_living_threads_init | ( | rb_ractor_t * | r | ) |

Definition at line 1546 of file ractor.c.

References rb_ractor_struct::blocking_cnt, rb_ractor_struct::cnt, rb_ractor_struct::set, and rb_ractor_struct::threads.

## ◆ rb_ractor_living_threads_insert()

void rb_ractor_living_threads_insert | ( | rb_ractor_t * | r,
|  | rb_thread_t * | th
| ) |  |

Definition at line 1760 of file ractor.c.

References rb_ractor_struct::cnt, rb_ractor_pub::id, rb_thread_struct::lt_node, NULL, rb_ractor_struct::pub, RACTOR_LOCK, RACTOR_UNLOCK, RUBY_DEBUG_LOG, rb_ractor_struct::set, rb_ractor_struct::threads, rb_thread_struct::vm, and VM_ASSERT.

Referenced by rb_ractor_main_setup().

## ◆ rb_ractor_living_threads_remove()

void rb_ractor_living_threads_remove | ( | rb_ractor_t * | cr,
|  | rb_thread_t * | th
| ) |  |

Definition at line 1838 of file ractor.c.

References rb_ractor_struct::cnt, rb_thread_struct::lt_node, RACTOR_LOCK, RACTOR_UNLOCK, RUBY_DEBUG_LOG, rb_ractor_struct::threads, rb_thread_struct::vm, and VM_ASSERT.

## ◆ rb_ractor_local_storage_delkey()

void rb_ractor_local_storage_delkey | ( | rb_ractor_local_key_t | key | ) |

Definition at line 3112 of file ractor.c.

References key, RB_VM_LOCK_ENTER, RB_VM_LOCK_LEAVE, and REALLOC_N.

## ◆ rb_ractor_local_storage_ptr()

void * rb_ractor_local_storage_ptr | ( | rb_ractor_local_key_t | key | ) |

Definition at line 3195 of file ractor.c.

References key, and NULL.

## ◆ rb_ractor_local_storage_ptr_newkey()

rb_ractor_local_key_t rb_ractor_local_storage_ptr_newkey | ( | const struct rb_ractor_local_storage_type * | type | ) |

Definition at line 3097 of file ractor.c.

References ALLOC, key, and Qundef.

Referenced by Init_ossl_bn(), InitVM_Random(), and rb_ractor_local_storage_value_newkey().

## ◆ rb_ractor_local_storage_ptr_set()

void rb_ractor_local_storage_ptr_set | ( | rb_ractor_local_key_t | key,
|  | void * | ptr
| ) |  |

Definition at line 3207 of file ractor.c.

References key, and ptr.

## ◆ rb_ractor_local_storage_value()

VALUE rb_ractor_local_storage_value | ( | rb_ractor_local_key_t | key | ) |

Definition at line 3166 of file ractor.c.

References key, and Qnil.

## ◆ rb_ractor_local_storage_value_lookup()

bool rb_ractor_local_storage_value_lookup | ( | rb_ractor_local_key_t | key,
|  | VALUE * | val
| ) |  |

Definition at line 3178 of file ractor.c.

References key.

## ◆ rb_ractor_local_storage_value_newkey()

rb_ractor_local_key_t rb_ractor_local_storage_value_newkey | ( | void |  | ) |

Definition at line 3106 of file ractor.c.

References rb_ractor_local_storage_ptr_newkey().

## ◆ rb_ractor_local_storage_value_set()

void rb_ractor_local_storage_value_set | ( | rb_ractor_local_key_t | key,
|  | VALUE | val
| ) |  |

Definition at line 3189 of file ractor.c.

References key.

## ◆ rb_ractor_main_alloc()

rb_ractor_t * rb_ractor_main_alloc | ( | void |  | ) |

Definition at line 1508 of file ractor.c.

References EXIT_FAILURE, rb_ractor_pub::id, rb_ractor_struct::loc, MEMZERO, rb_ractor_struct::name, NULL, rb_ractor_struct::pub, Qnil, ruby_mimmalloc(), ruby_single_main_ractor, and rb_ractor_pub::self.

Referenced by Init_BareVM().

## ◆ rb_ractor_main_p_()

bool rb_ractor_main_p_ | ( | void |  | ) |

Definition at line 1699 of file ractor.c.

References VM_ASSERT.

## ◆ rb_ractor_main_setup()

void rb_ractor_main_setup | ( | rb_vm_t * | vm,
|  | rb_ractor_t * | r,
|  | rb_thread_t * | th
| ) |  |

Definition at line 1581 of file ractor.c.

References FL_SET_RAW, rb_ractor_struct::main, rb_ractor_struct::pub, Qnil, rb_cRactor, rb_ractor_living_threads_insert(), RUBY_FL_SHAREABLE, rb_ractor_pub::self, rb_ractor_struct::threads, and TypedData_Wrap_Struct.

Referenced by Init_VM().

## ◆ rb_ractor_make_shareable()

VALUE rb_ractor_make_shareable | ( | VALUE | obj | ) |

Definition at line 2499 of file ractor.c.

## ◆ rb_ractor_make_shareable_copy()

VALUE rb_ractor_make_shareable_copy | ( | VALUE | obj | ) |

Definition at line 2508 of file ractor.c.

## ◆ rb_ractor_p()

bool rb_ractor_p | ( | VALUE | gv | ) |

Definition at line 273 of file ractor.c.

References rb_typeddata_is_kind_of().

Referenced by rb_obj_is_main_ractor(), and rb_raw_obj_info().

## ◆ rb_ractor_receive_parameters()

void rb_ractor_receive_parameters | ( | rb_execution_context_t * | ec,
|  | rb_ractor_t * | r,
|  | int | len,
|  | VALUE * | ptr
| ) |  |

Definition at line 1682 of file ractor.c.

References len, and ptr.

## ◆ rb_ractor_send_parameters()

void rb_ractor_send_parameters | ( | rb_execution_context_t * | ec,
|  | rb_ractor_t * | r,
|  | VALUE | args
| ) |  |

Definition at line 1690 of file ractor.c.

References len, and RARRAY_AREF.

## ◆ rb_ractor_shareable_p_continue()

bool rb_ractor_shareable_p_continue | ( | VALUE | obj | ) |

Definition at line 2550 of file ractor.c.

## ◆ rb_ractor_stderr()

VALUE rb_ractor_stderr | ( | void |  | ) |

Definition at line 2148 of file ractor.c.

References rb_ractor_struct::r_stderr, and rb_stderr.

Referenced by rb_f_abort(), rb_parser_fatal(), rb_write_error2(), and rb_write_error_str().

## ◆ rb_ractor_stderr_set()

void rb_ractor_stderr_set | ( | VALUE | err | ) |

Definition at line 2184 of file ractor.c.

References err, rb_ractor_struct::pub, rb_ractor_struct::r_stderr, RB_OBJ_WRITE, rb_stderr, and rb_ractor_pub::self.

## ◆ rb_ractor_stdin()

VALUE rb_ractor_stdin | ( | void |  | ) |

Definition at line 2124 of file ractor.c.

References rb_ractor_struct::r_stdin, and rb_stdin.

## ◆ rb_ractor_stdin_set()

void rb_ractor_stdin_set | ( | VALUE | in | ) |

Definition at line 2160 of file ractor.c.

References in(), rb_ractor_struct::pub, rb_ractor_struct::r_stdin, RB_OBJ_WRITE, rb_stdin, and rb_ractor_pub::self.

## ◆ rb_ractor_stdout()

VALUE rb_ractor_stdout | ( | void |  | ) |

Definition at line 2136 of file ractor.c.

References rb_ractor_struct::r_stdout, and rb_stdout.

Referenced by rb_io_getbyte(), and rb_parser_fatal().

## ◆ rb_ractor_stdout_set()

void rb_ractor_stdout_set | ( | VALUE | out | ) |

Definition at line 2172 of file ractor.c.

References out, rb_ractor_struct::pub, rb_ractor_struct::r_stdout, RB_OBJ_WRITE, rb_stdout, and rb_ractor_pub::self.

## ◆ rb_ractor_teardown()

void rb_ractor_teardown | ( | rb_execution_context_t * | ec | ) |

Definition at line 1652 of file ractor.c.

References rb_ractor_struct::main, NULL, RB_VM_LOCK_ENTER, RB_VM_LOCK_LEAVE, rb_ractor_struct::threads, and VM_ASSERT.

## ◆ rb_ractor_terminate_all()

void rb_ractor_terminate_all | ( | void |  | ) |

Definition at line 1946 of file ractor.c.

References rb_vm_struct::cnt, rb_vm_struct::main_ractor, rb_vm_struct::ractor, rb_thread_terminate_all(), rb_vm_cond_timedwait(), RB_VM_LOCK, rb_vm_ractor_blocking_cnt_dec(), rb_vm_ractor_blocking_cnt_inc(), RB_VM_UNLOCK, RUBY_DEBUG_LOG, rb_vm_struct::sync, rb_vm_struct::terminate_cond, rb_vm_struct::terminate_waiting, and VM_ASSERT.

## ◆ rb_ractor_terminate_interrupt_main_thread()

void rb_ractor_terminate_interrupt_main_thread | ( | rb_ractor_t * | r | ) |

Definition at line 1911 of file ractor.c.

References ASSERT_vm_locking, rb_thread_struct::ec, rb_ractor_struct::main, rb_threadptr_interrupt(), RUBY_DEBUG_LOG, RUBY_VM_SET_TERMINATE_INTERRUPT, THREAD_KILLED, rb_ractor_struct::threads, and VM_ASSERT.

## ◆ rb_ractor_thread_list()

VALUE rb_ractor_thread_list | ( | rb_ractor_t * | r | ) |

Definition at line 1727 of file ractor.c.

References ALLOCA_N, rb_ractor_struct::cnt, RACTOR_LOCK, RACTOR_UNLOCK, rb_ary_new(), rb_ary_push(), rb_thread_struct::self, rb_ractor_struct::set, THREAD_RUNNABLE, THREAD_STOPPED, THREAD_STOPPED_FOREVER, and rb_ractor_struct::threads.

Referenced by rb_thread_list().

## ◆ rb_ractor_vm_barrier_interrupt_running_thread()

void rb_ractor_vm_barrier_interrupt_running_thread | ( | rb_ractor_t * | r | ) |

Definition at line 1892 of file ractor.c.

References ASSERT_vm_locking, RACTOR_LOCK, RACTOR_UNLOCK, RUBY_VM_SET_VM_BARRIER_INTERRUPT, rb_ractor_struct::running_ec, rb_ractor_struct::threads, and VM_ASSERT.

Referenced by rb_vm_barrier().

## ◆ rb_replace_generic_ivar()

void rb_replace_generic_ivar | ( | VALUE | clone,
|  | VALUE | obj
| ) |  |

Definition at line 1689 of file variable.c.

References FL_EXIVAR, FL_SET, FL_TEST, NULL, givar_copy::obj, rb_bug(), RB_VM_LOCK_ENTER, RB_VM_LOCK_LEAVE, RUBY_ASSERT, st_delete, st_insert, and st_lookup.

## ◆ rb_thread_terminate_all()

void rb_thread_terminate_all | ( | rb_thread_t * | th | ) |

Definition at line 581 of file thread.c.

References rb_thread_struct::ec, EC_EXEC_TAG, EC_POP_TAG, EC_PUSH_TAG, rb_ractor_struct::main, rb_thread_struct::ractor, rb_bug(), RB_HRTIME_PER_SEC, rb_ractor_living_thread_num(), rb_threadptr_unlock_all_locking_mutexes(), RUBY_VM_CHECK_INTS_BLOCKING, TAG_NONE, thread_debug, and rb_ractor_struct::threads.

Referenced by rb_ractor_terminate_all().

## ◆ rb_vm_main_ractor_ec()

rb_execution_context_t * rb_vm_main_ractor_ec | ( | rb_vm_t * | vm | ) |

Definition at line 1978 of file ractor.c.

References rb_vm_struct::main_ractor, rb_vm_struct::ractor, rb_ractor_struct::running_ec, and rb_ractor_struct::threads.

Referenced by rb_workqueue_register().

## ◆ rb_vm_ractor_blocking_cnt_dec()

void rb_vm_ractor_blocking_cnt_dec | ( | rb_vm_t * | vm,
|  | rb_ractor_t * | cr,
|  | const char * | file,
|  | int | line
| ) |  |

Definition at line 1798 of file ractor.c.

References ASSERT_vm_locking, rb_vm_struct::blocking_cnt, rb_vm_struct::ractor, RUBY_DEBUG_LOG2, and VM_ASSERT.

Referenced by rb_ractor_blocking_threads_dec(), rb_ractor_terminate_all(), and rb_vm_barrier().

## ◆ rb_vm_ractor_blocking_cnt_inc()

void rb_vm_ractor_blocking_cnt_inc | ( | rb_vm_t * | vm,
|  | rb_ractor_t * | cr,
|  | const char * | file,
|  | int | line
| ) |  |

Definition at line 1790 of file ractor.c.

References ASSERT_vm_locking, and VM_ASSERT.

Referenced by rb_ractor_terminate_all(), and rb_vm_barrier().

## Variable Documentation

## ◆ rb_cRactor

VALUE rb_cRactor

Definition at line 20 of file ractor.c.

Referenced by Init_Ractor(), and rb_ractor_main_setup().

## ◆ rb_eRactorIsolationError

VALUE rb_eRactorIsolationError

Definition at line 23 of file ractor.c.

Referenced by Init_Ractor(), rb_alias_variable(), rb_const_set(), rb_f_global_variables(), and rb_ractor_ensure_shareable().

## ◆ rb_eRactorUnsafeError

VALUE rb_eRactorUnsafeError

Definition at line 22 of file ractor.c.

Referenced by Init_Ractor().

## ◆ rb_ractor_local_storage_type_free

const struct rb_ractor_local_storage_type rb_ractor_local_storage_type_free

Initial value:
= {
NULL,
ruby_xfree,
}
ruby_xfree
void ruby_xfree(void *x)
Deallocates a storage instance.
Definition: gc.c:10914
NULL
#define NULL
Definition: regenc.h:69

Definition at line 3086 of file ractor.c.