Ruby: thread.c File Reference

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

Data Structures | Macros | Enumerations | Functions
thread.c File Reference
`#include "ruby/internal/config.h"`
`#include "eval_intern.h"`
`#include "gc.h"`
`#include "hrtime.h"`
`#include "internal.h"`
`#include "internal/class.h"`
`#include "internal/cont.h"`
`#include "internal/error.h"`
`#include "internal/hash.h"`
`#include "internal/io.h"`
`#include "internal/object.h"`
`#include "internal/proc.h"`
`#include "internal/scheduler.h"`
`#include "internal/signal.h"`
`#include "internal/thread.h"`
`#include "internal/time.h"`
`#include "internal/warnings.h"`
`#include "iseq.h"`
`#include "mjit.h"`
`#include "ruby/debug.h"`
`#include "ruby/io.h"`
`#include "ruby/thread.h"`
`#include "ruby/thread_native.h"`
`#include "timev.h"`
`#include "vm_core.h"`
`#include "ractor_core.h"`
`#include "vm_debug.h"`
`#include "vm_sync.h"`
`#include "thread_sync.c"`

Go to the source code of this file.

## Data Structures
struct | waiting_fd
struct | rb_blocking_region_buffer
struct | thread_create_params
struct | join_arg
struct | select_set
struct | select_args
struct | thgroup
struct | exec_recursive_params

## Macros
#define | __USE_FORTIFY_LEVEL 0
#define | USE_NATIVE_THREAD_PRIORITY 0
#define | RUBY_THREAD_PRIORITY_MAX 3
#define | RUBY_THREAD_PRIORITY_MIN -3
#define | THREAD_DEBUG 0
#define | THREAD_LOCAL_STORAGE_INITIALISED FL_USER13
#define | THREAD_LOCAL_STORAGE_INITIALISED_P(th) RB_FL_TEST_RAW((th), THREAD_LOCAL_STORAGE_INITIALISED)
#define | eKillSignal INT2FIX(0)
#define | eTerminateSignal INT2FIX(1)
#define | THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION
#define | GVL_UNLOCK_BEGIN(th)
#define | GVL_UNLOCK_END(th)
#define | only_if_constant(expr, notconst) (__builtin_constant_p(expr) ? (expr) : (notconst))
#define | BLOCKING_REGION(th, exec, ubf, ubfarg, fail_if_interrupted)
#define | RUBY_VM_CHECK_INTS_BLOCKING(ec) vm_check_ints_blocking(ec)
#define | thread_debug if(0)printf
#define | fill_thread_id_string(thid, buf) ((void *)(uintptr_t)(thid))
#define | fill_thread_id_str(th) (void)0
#define | thread_id_str(th) ((void *)(uintptr_t)(th)->thread_id)
#define | PRI_THREAD_ID "p"
#define | BUSY_WAIT_SIGNALS (0)
#define | USE_EVENTFD (0)
#define | threadptr_initialized(th) ((th)->invoke_type != thread_invoke_type_none)
#define | TIMESPEC_SEC_MAX TIMET_MAX
#define | TIMESPEC_SEC_MIN TIMET_MIN
#define | PRIu64 PRI_64_PREFIX "u"
#define | rb_fd_no_init(fds) (void)(fds)
#define | restore_fdset(dst, src) ((dst) ? rb_fd_dup(dst, src) : (void)0)
#define | do_select_update()
#define | fd_init_copy(f)
#define | GetThreadShieldPtr(obj) ((VALUE)rb_check_typeddata((obj), &thread_shield_data_type))
#define | THREAD_SHIELD_WAITING_MASK (((FL_USER19-1)&~(FL_USER0-1))|FL_USER19)
#define | THREAD_SHIELD_WAITING_SHIFT (FL_USHIFT)
#define | THREAD_SHIELD_WAITING_MAX (THREAD_SHIELD_WAITING_MASK>>THREAD_SHIELD_WAITING_SHIFT)
#define | OBJ_ID_EQL(obj_id, other) ((obj_id) == (other))

## Enumerations
enum | SLEEP_FLAGS { SLEEP_DEADLOCKABLE = 0x1 , SLEEP_SPURIOUS_CHECK = 0x2 }
enum | handle_interrupt_timing { INTERRUPT_NONE , INTERRUPT_IMMEDIATE , INTERRUPT_ON_BLOCKING , INTERRUPT_NEVER }

## Functions
void | rb_sigwait_fd_migrate (rb_vm_t *)
int | rb_vm_check_ints_blocking (rb_execution_context_t *ec)
void | ruby_sigchld_handler (rb_vm_t *)
void | rb_vm_gvl_destroy (rb_global_vm_lock_t *gvl)
void | rb_nativethread_lock_initialize (rb_nativethread_lock_t *lock)
void | rb_nativethread_lock_destroy (rb_nativethread_lock_t *lock)
void | rb_nativethread_lock_lock (rb_nativethread_lock_t *lock)
void | rb_nativethread_lock_unlock (rb_nativethread_lock_t *lock)
void | rb_threadptr_interrupt (rb_thread_t *th)
void | rb_threadptr_unlock_all_locking_mutexes (rb_thread_t *th)
void | rb_thread_terminate_all (rb_thread_t *th)
void | rb_threadptr_root_fiber_terminate (rb_thread_t *th)
void | ruby_thread_init_stack (rb_thread_t *th)
const VALUE * | rb_vm_proc_local_ep (VALUE proc)
VALUE | rb_vm_invoke_proc_with_self (rb_execution_context_t *ec, rb_proc_t *proc, VALUE self, int argc, const VALUE *argv, int kw_splat, VALUE passed_block_handler)
void | rb_ec_clear_current_thread_trace_func (const rb_execution_context_t *ec)
VALUE | rb_io_prep_stdin (void)
VALUE | rb_io_prep_stdout (void)
VALUE | rb_io_prep_stderr (void)
VALUE | rb_thread_create (VALUE(*fn)(void *), void *arg)
VALUE | rb_thread_create_ractor (rb_ractor_t *g, VALUE args, VALUE proc)
rb_hrtime_t | rb_hrtime_now (void)
void | rb_thread_sleep_forever (void)
void | rb_thread_sleep_deadly (void)
void | rb_thread_sleep_interruptible (void)
void | rb_thread_wait_for (struct timeval time)
void | rb_thread_check_ints (void)
int | rb_thread_check_trap_pending (void)
int | rb_thread_interrupted (VALUE thval)
void | rb_thread_sleep (int sec)
void | rb_thread_schedule (void)
void * | rb_nogvl (void *(*func)(void *), void *data1, rb_unblock_function_t *ubf, void *data2, int flags)
void * | rb_thread_call_without_gvl2 (void *(*func)(void *), void *data1, rb_unblock_function_t *ubf, void *data2)
void * | rb_thread_call_without_gvl (void *(*func)(void *data), void *data1, rb_unblock_function_t *ubf, void *data2)
VALUE | rb_thread_io_blocking_region (rb_blocking_function_t *func, void *data1, int fd)
void * | rb_thread_call_with_gvl (void *(*func)(void *), void *data1)
int | ruby_thread_has_gvl_p (void)
void | rb_threadptr_pending_interrupt_clear (rb_thread_t *th)
void | rb_threadptr_pending_interrupt_enque (rb_thread_t *th, VALUE v)
int | rb_threadptr_execute_interrupts (rb_thread_t *th, int blocking_timing)
void | rb_thread_execute_interrupts (VALUE thval)
void | rb_threadptr_signal_raise (rb_thread_t *th, int sig)
void | rb_threadptr_signal_exit (rb_thread_t *th)
int | rb_ec_set_raised (rb_execution_context_t *ec)
int | rb_ec_reset_raised (rb_execution_context_t *ec)
int | rb_notify_fd_close (int fd, struct list_head *busy)
void | rb_thread_fd_close (int fd)
VALUE | rb_thread_kill (VALUE thread)
int | rb_thread_to_be_killed (VALUE thread)
VALUE | rb_thread_wakeup (VALUE thread)
VALUE | rb_thread_wakeup_alive (VALUE thread)
VALUE | rb_thread_run (VALUE thread)
VALUE | rb_thread_stop (void)
VALUE | rb_thread_list (void)
VALUE | rb_thread_current (void)
VALUE | rb_thread_main (void)
VALUE | rb_thread_group (VALUE thread)
VALUE | rb_thread_local_aref (VALUE thread, ID id)
VALUE | rb_thread_local_aset (VALUE thread, ID id, VALUE val)
int | rb_thread_alone (void)
void | rb_thread_wait_fd (int fd)
int | rb_thread_fd_writable (int fd)
int | rb_thread_fd_select (int max, rb_fdset_t *read, rb_fdset_t *write, rb_fdset_t *except, struct timeval *timeout)
int | rb_thread_wait_for_single_fd (int fd, int events, struct timeval *timeout)
void | rb_gc_set_stack_end (VALUE **stack_end_p)
void | rb_threadptr_check_signal (rb_thread_t *mth)
void | rb_thread_stop_timer_thread (void)
void | rb_thread_reset_timer_thread (void)
void | rb_thread_start_timer_thread (void)
void | rb_clear_coverages (void)
void | rb_thread_atfork (void)
void | rb_thread_atfork_before_exec (void)
| STATIC_ASSERT (THREAD_SHIELD_WAITING_MAX, THREAD_SHIELD_WAITING_MAX<=UINT_MAX)
VALUE | rb_thread_shield_new (void)
VALUE | rb_thread_shield_wait (VALUE self)
VALUE | rb_thread_shield_release (VALUE self)
VALUE | rb_thread_shield_destroy (VALUE self)
ID | rb_frame_last_func (void)
| Returns the ID of the last method in the call stack. More...
VALUE | rb_exec_recursive (VALUE(*func)(VALUE, VALUE, int), VALUE obj, VALUE arg)
VALUE | rb_exec_recursive_paired (VALUE(*func)(VALUE, VALUE, int), VALUE obj, VALUE paired_obj, VALUE arg)
VALUE | rb_exec_recursive_outer (VALUE(*func)(VALUE, VALUE, int), VALUE obj, VALUE arg)
VALUE | rb_exec_recursive_paired_outer (VALUE(*func)(VALUE, VALUE, int), VALUE obj, VALUE paired_obj, VALUE arg)
void | Init_Thread_Mutex (void)
void | Init_Thread (void)
int | ruby_native_thread_p (void)
const rb_method_entry_t * | rb_resolve_me_location (const rb_method_entry_t *me, VALUE resolved_location[5])
VALUE | rb_get_coverages (void)
int | rb_get_coverage_mode (void)
void | rb_set_coverages (VALUE coverages, int mode, VALUE me2counter)
void | rb_reset_coverages (void)
VALUE | rb_default_coverage (int n)
VALUE | rb_uninterruptible (VALUE(*b_proc)(VALUE), VALUE data)

## Macro Definition Documentation

## ◆ __USE_FORTIFY_LEVEL

#define __USE_FORTIFY_LEVEL 0

Definition at line 62 of file thread.c.

## ◆ BLOCKING_REGION

#define BLOCKING_REGION | ( |  | th,
|  |  | exec,
|  |  | ubf,
|  |  | ubfarg,
|  |  | fail_if_interrupted
| ) |  |

Value:
do { \
struct rb_blocking_region_buffer __region; \
if (blocking_region_begin(th, &__region, (ubf), (ubfarg), fail_if_interrupted) || \
/* always return true unless fail_if_interrupted */ \
!only_if_constant(fail_if_interrupted, TRUE)) { \
exec; \
blocking_region_end(th, &__region); \
}; \
} while(0)
TRUE
#define TRUE
Definition: nkf.h:175
rb_blocking_region_buffer
Definition: thread.c:162
only_if_constant
#define only_if_constant(expr, notconst)
Definition: thread.c:186

Definition at line 191 of file thread.c.

## ◆ BUSY_WAIT_SIGNALS

#define BUSY_WAIT_SIGNALS (0)

Definition at line 381 of file thread.c.

## ◆ do_select_update

#define do_select_update | ( |  | ) |

Value:
(restore_fdset(set->rset, &set->orig_rset), \
restore_fdset(set->wset, &set->orig_wset), \
restore_fdset(set->eset, &set->orig_eset), \
TRUE)
restore_fdset
#define restore_fdset(dst, src)

## ◆ eKillSignal

#define eKillSignal INT2FIX(0)

Definition at line 148 of file thread.c.

## ◆ eTerminateSignal

#define eTerminateSignal INT2FIX(1)

Definition at line 149 of file thread.c.

## ◆ fd_init_copy

#define fd_init_copy | ( |  | f | ) |

Value:
do { \
if (set.f) { \
rb_fd_resize(set.max - 1, set.f); \
if (&set.orig_##f != set.f) { /* sigwait_fd */ \
rb_fd_init_copy(&set.orig_##f, set.f); \
} \
} \
else { \
rb_fd_no_init(&set.orig_##f); \
} \
} while (0)
f
#define f

## ◆ fill_thread_id_str

#define fill_thread_id_str | ( |  | th | ) | (void)0

Definition at line 338 of file thread.c.

## ◆ fill_thread_id_string

#define fill_thread_id_string | ( |  | thid,
|  |  | buf
| ) |  | ((void *)(uintptr_t)(thid))

Definition at line 337 of file thread.c.

## ◆ GetThreadShieldPtr

#define GetThreadShieldPtr | ( |  | obj | ) | ((VALUE)rb_check_typeddata((obj), &thread_shield_data_type))

Definition at line 5039 of file thread.c.

## ◆ GVL_UNLOCK_BEGIN

#define GVL_UNLOCK_BEGIN | ( |  | th | ) |

Value:
do { \
RB_GC_SAVE_MACHINE_CONTEXT(th); \
gvl_release(rb_ractor_gvl(th->ractor));
rb_ractor_gvl
rb_global_vm_lock_t * rb_ractor_gvl(rb_ractor_t *r)
Definition: ractor.c:1715

Definition at line 173 of file thread.c.

## ◆ GVL_UNLOCK_END

#define GVL_UNLOCK_END | ( |  | th | ) |

Value:
gvl_acquire(rb_ractor_gvl(th->ractor), th); \
rb_ractor_thread_switch(th->ractor, th); \
} while(0)

Definition at line 177 of file thread.c.

## ◆ OBJ_ID_EQL

#define OBJ_ID_EQL | ( |  | obj_id,
|  |  | other
| ) |  | ((obj_id) == (other))

## ◆ only_if_constant

#define only_if_constant | ( |  | expr,
|  |  | notconst
| ) |  | (__builtin_constant_p(expr) ? (expr) : (notconst))

Definition at line 186 of file thread.c.

## ◆ PRI_THREAD_ID

#define PRI_THREAD_ID "p"

Definition at line 340 of file thread.c.

## ◆ PRIu64

#define PRIu64 PRI_64_PREFIX "u"

Definition at line 1482 of file thread.c.

## ◆ rb_fd_no_init

#define rb_fd_no_init | ( |  | fds | ) | (void)(fds)

Definition at line 4156 of file thread.c.

## ◆ restore_fdset

#define restore_fdset | ( |  | dst,
|  |  | src
| ) |  | ((dst) ? rb_fd_dup(dst, src) : (void)0)

## ◆ RUBY_THREAD_PRIORITY_MAX

#define RUBY_THREAD_PRIORITY_MAX 3

Definition at line 103 of file thread.c.

## ◆ RUBY_THREAD_PRIORITY_MIN

#define RUBY_THREAD_PRIORITY_MIN -3

Definition at line 104 of file thread.c.

## ◆ RUBY_VM_CHECK_INTS_BLOCKING

#define RUBY_VM_CHECK_INTS_BLOCKING | ( |  | ec | ) | vm_check_ints_blocking(ec)

Definition at line 205 of file thread.c.

## ◆ THREAD_DEBUG

#define THREAD_DEBUG 0

Definition at line 108 of file thread.c.

## ◆ thread_debug

#define thread_debug if(0)printf

Definition at line 333 of file thread.c.

## ◆ thread_id_str

#define thread_id_str | ( |  | th | ) | ((void *)(uintptr_t)(th)->thread_id)

Definition at line 339 of file thread.c.

## ◆ THREAD_LOCAL_STORAGE_INITIALISED

#define THREAD_LOCAL_STORAGE_INITIALISED FL_USER13

Definition at line 122 of file thread.c.

## ◆ THREAD_LOCAL_STORAGE_INITIALISED_P

#define THREAD_LOCAL_STORAGE_INITIALISED_P | ( |  | th | ) | RB_FL_TEST_RAW((th), THREAD_LOCAL_STORAGE_INITIALISED)

Definition at line 123 of file thread.c.

## ◆ THREAD_SHIELD_WAITING_MASK

#define THREAD_SHIELD_WAITING_MASK (((FL_USER19-1)&~(FL_USER0-1))|FL_USER19)

Definition at line 5040 of file thread.c.

## ◆ THREAD_SHIELD_WAITING_MAX

#define THREAD_SHIELD_WAITING_MAX (THREAD_SHIELD_WAITING_MASK>>THREAD_SHIELD_WAITING_SHIFT)

Definition at line 5042 of file thread.c.

## ◆ THREAD_SHIELD_WAITING_SHIFT

#define THREAD_SHIELD_WAITING_SHIFT (FL_USHIFT)

Definition at line 5041 of file thread.c.

## ◆ THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION

#define THREAD_SYSTEM_DEPENDENT_IMPLEMENTATION

Definition at line 160 of file thread.c.

## ◆ threadptr_initialized

#define threadptr_initialized | ( |  | th | ) | ((th)->invoke_type != thread_invoke_type_none)

Definition at line 1015 of file thread.c.

## ◆ TIMESPEC_SEC_MAX

#define TIMESPEC_SEC_MAX TIMET_MAX

Definition at line 1392 of file thread.c.

## ◆ TIMESPEC_SEC_MIN

#define TIMESPEC_SEC_MIN TIMET_MIN

Definition at line 1393 of file thread.c.

## ◆ USE_EVENTFD

#define USE_EVENTFD (0)

Definition at line 385 of file thread.c.

## ◆ USE_NATIVE_THREAD_PRIORITY

#define USE_NATIVE_THREAD_PRIORITY 0

Definition at line 102 of file thread.c.

## Enumeration Type Documentation

## ◆ handle_interrupt_timing

enum handle_interrupt_timing

Enumerator
INTERRUPT_NONE |
INTERRUPT_IMMEDIATE |
INTERRUPT_ON_BLOCKING |
INTERRUPT_NEVER |

Definition at line 2001 of file thread.c.

## ◆ SLEEP_FLAGS

enum SLEEP_FLAGS

Enumerator
SLEEP_DEADLOCKABLE |
SLEEP_SPURIOUS_CHECK |

Definition at line 117 of file thread.c.

## Function Documentation

## ◆ Init_Thread()

void Init_Thread | ( | void |  | ) |

Definition at line 5457 of file thread.c.

References ID2SYM, rb_thread_struct::pending_interrupt_mask_stack, rb_thread_struct::pending_interrupt_queue, rb_thread_struct::pending_interrupt_queue_checked, rb_thread_struct::ractor, rb_ary_tmp_new(), rb_cObject, rb_cThread, rb_define_alias(), rb_define_alloc_func(), rb_define_class(), rb_define_const(), rb_define_method, rb_define_singleton_method, rb_eIOError, rb_eStandardError, rb_eThreadError, rb_obj_alloc(), rb_ractor_gvl(), rb_thread_group(), rb_thread_kill(), rb_thread_run(), rb_thread_wakeup(), rb_vm_register_special_exception, ruby_error_stream_closed, rb_thread_struct::thgroup, and rb_ractor_struct::thgroup_default.

## ◆ Init_Thread_Mutex()

void Init_Thread_Mutex | ( | void |  | ) |

Definition at line 5432 of file thread.c.

References rb_thread_struct::interrupt_lock, rb_native_mutex_initialize(), rb_thread_struct::vm, rb_vm_struct::waitpid_lock, and rb_vm_struct::workqueue_lock.

## ◆ rb_clear_coverages()

void rb_clear_coverages | ( | void |  | ) |

Definition at line 4739 of file thread.c.

References rb_get_coverages(), rb_hash_foreach(), and RTEST.

Referenced by rb_reset_coverages().

## ◆ rb_default_coverage()

VALUE rb_default_coverage | ( | int | n | ) |

Definition at line 5815 of file thread.c.

References COVERAGE_INDEX_BRANCHES, COVERAGE_INDEX_LINES, COVERAGE_TARGET_BRANCHES, COVERAGE_TARGET_LINES, Qfalse, rb_ary_tmp_new(), rb_ary_tmp_new_fill(), rb_hash_new(), and rb_obj_hide().

Referenced by rb_iseq_new_top().

## ◆ rb_ec_clear_current_thread_trace_func()

void rb_ec_clear_current_thread_trace_func | ( | const rb_execution_context_t * | ec | ) |

Definition at line 277 of file vm_trace.c.

## ◆ rb_ec_reset_raised()

int rb_ec_reset_raised | ( | rb_execution_context_t * | ec | ) |

Definition at line 2597 of file thread.c.

References RAISED_EXCEPTION, and rb_execution_context_struct::raised_flag.

Referenced by rb_suppress_tracing().

## ◆ rb_ec_set_raised()

int rb_ec_set_raised | ( | rb_execution_context_t * | ec | ) |

Definition at line 2587 of file thread.c.

References RAISED_EXCEPTION, and rb_execution_context_struct::raised_flag.

## ◆ rb_exec_recursive()

VALUE rb_exec_recursive | ( | VALUE(*)(VALUE, VALUE, int) | func,
|  | VALUE | obj,
|  | VALUE | arg
| ) |  |

Definition at line 5360 of file thread.c.

References exec_recursive_params::arg, exec_recursive_params::func, and exec_recursive_params::obj.

Referenced by rb_error_frozen_object(), rb_invcmp(), and rb_io_puts().

## ◆ rb_exec_recursive_outer()

VALUE rb_exec_recursive_outer | ( | VALUE(*)(VALUE, VALUE, int) | func,
|  | VALUE | obj,
|  | VALUE | arg
| ) |  |

Definition at line 5383 of file thread.c.

References exec_recursive_params::arg, exec_recursive_params::func, and exec_recursive_params::obj.

Referenced by rb_hash().

## ◆ rb_exec_recursive_paired()

VALUE rb_exec_recursive_paired | ( | VALUE(*)(VALUE, VALUE, int) | func,
|  | VALUE | obj,
|  | VALUE | paired_obj,
|  | VALUE | arg
| ) |  |

Definition at line 5371 of file thread.c.

References exec_recursive_params::arg, exec_recursive_params::func, exec_recursive_params::obj, and rb_memory_id().

Referenced by rb_ary_cmp(), and rb_num_coerce_bit().

## ◆ rb_exec_recursive_paired_outer()

VALUE rb_exec_recursive_paired_outer | ( | VALUE(*)(VALUE, VALUE, int) | func,
|  | VALUE | obj,
|  | VALUE | paired_obj,
|  | VALUE | arg
| ) |  |

Definition at line 5395 of file thread.c.

References exec_recursive_params::arg, exec_recursive_params::func, exec_recursive_params::obj, and rb_memory_id().

## ◆ rb_gc_set_stack_end()

void rb_gc_set_stack_end | ( | VALUE ** | stack_end_p | ) |

Definition at line 4586 of file thread.c.

## ◆ rb_get_coverage_mode()

int rb_get_coverage_mode | ( | void |  | ) |

Definition at line 5779 of file thread.c.

Referenced by rb_iseq_new_top().

## ◆ rb_get_coverages()

VALUE rb_get_coverages | ( | void |  | ) |

Definition at line 5773 of file thread.c.

Referenced by rb_clear_coverages(), and rb_iseq_new_top().

## ◆ rb_hrtime_now()

rb_hrtime_t rb_hrtime_now | ( | void |  | ) |

Definition at line 1439 of file thread.c.

## ◆ rb_io_prep_stderr()

VALUE rb_io_prep_stderr | ( | void |  | ) |

Definition at line 8223 of file io.c.

References FMODE_SYNC, FMODE_WRITABLE, and rb_cIO.

Referenced by Init_IO().

## ◆ rb_io_prep_stdin()

VALUE rb_io_prep_stdin | ( | void |  | ) |

Definition at line 8211 of file io.c.

References FMODE_READABLE, and rb_cIO.

Referenced by Init_IO().

## ◆ rb_io_prep_stdout()

VALUE rb_io_prep_stdout | ( | void |  | ) |

Definition at line 8217 of file io.c.

References FMODE_SIGNAL_ON_EPIPE, FMODE_WRITABLE, and rb_cIO.

Referenced by Init_IO().

## ◆ rb_nativethread_lock_destroy()

void rb_nativethread_lock_destroy | ( | rb_nativethread_lock_t * | lock | ) |

Definition at line 436 of file thread.c.

References rb_native_mutex_destroy().

## ◆ rb_nativethread_lock_initialize()

void rb_nativethread_lock_initialize | ( | rb_nativethread_lock_t * | lock | ) |

Definition at line 430 of file thread.c.

References rb_native_mutex_initialize().

## ◆ rb_nativethread_lock_lock()

void rb_nativethread_lock_lock | ( | rb_nativethread_lock_t * | lock | ) |

Definition at line 442 of file thread.c.

References rb_native_mutex_lock().

Referenced by rb_grantpt(), rb_postponed_job_flush(), and rb_workqueue_register().

## ◆ rb_nativethread_lock_unlock()

void rb_nativethread_lock_unlock | ( | rb_nativethread_lock_t * | lock | ) |

Definition at line 448 of file thread.c.

References rb_native_mutex_unlock().

Referenced by rb_grantpt(), rb_postponed_job_flush(), and rb_workqueue_register().

## ◆ rb_nogvl()

void * rb_nogvl | ( | void *(*)(void *) | func,
|  | void * | data1,
|  | rb_unblock_function_t * | ubf,
|  | void * | data2,
|  | int | flags
| ) |  |

Definition at line 1670 of file thread.c.

References BLOCKING_REGION, rb_vm_struct::main_thread, Qfalse, rb_vm_struct::ractor, rb_thread_struct::ractor, RB_NOGVL_INTR_FAIL, RB_NOGVL_UBF_ASYNC_SAFE, rb_ractor_living_thread_num(), rb_thread_kill(), RUBY_UBF_IO, RUBY_UBF_PROCESS, RUBY_VM_CHECK_INTS_BLOCKING, and rb_vm_struct::ubf_async_safe.

Referenced by rb_thread_call_without_gvl(), and rb_thread_call_without_gvl2().

## ◆ rb_notify_fd_close()

int rb_notify_fd_close | ( | int | fd,
|  | struct list_head * | busy
| ) |  |

Definition at line 2607 of file thread.c.

References err, waiting_fd::fd, rb_threadptr_interrupt(), rb_threadptr_pending_interrupt_enque(), RB_VM_LOCK_ENTER, RB_VM_LOCK_LEAVE, ruby_error_stream_closed, rb_vm_struct::special_exceptions, waiting_fd::th, rb_thread_struct::vm, rb_vm_struct::waiting_fds, and waiting_fd::wfd_node.

Referenced by rb_thread_fd_close().

## ◆ rb_reset_coverages()

void rb_reset_coverages | ( | void |  | ) |

Definition at line 5800 of file thread.c.

References COVERAGE_TARGET_BRANCHES, COVERAGE_TARGET_METHODS, Qfalse, rb_clear_coverages(), rb_iseq_remove_coverage_all(), and rb_remove_event_hook().

## ◆ rb_resolve_me_location()

const rb_method_entry_t * rb_resolve_me_location | ( | const rb_method_entry_t * | me,
|  | VALUE | resolved_location[5]
| ) |  |

Definition at line 5694 of file thread.c.

References rb_method_definition_struct::alias, rb_code_location_struct::beg_pos, rb_method_definition_struct::bmethod, rb_method_definition_struct::body, rb_iseq_struct::body, rb_iseq_location_struct::code_location, rb_code_position_struct::column, rb_method_entry_struct::def, rb_code_location_struct::end_pos, INT2FIX, rb_method_definition_struct::iseq, rb_method_iseq_struct::iseqptr, rb_code_position_struct::lineno, rb_iseq_constant_body::location, NULL, rb_method_refined_struct::orig_me, rb_method_alias_struct::original_me, rb_method_bmethod_struct::proc, rb_ary_entry(), rb_iseq_path(), rb_proc_get_iseq(), rb_method_definition_struct::refined, T_ARRAY, T_STRING, VM_METHOD_TYPE_ALIAS, VM_METHOD_TYPE_BMETHOD, VM_METHOD_TYPE_ISEQ, and VM_METHOD_TYPE_REFINED.

## ◆ rb_set_coverages()

void rb_set_coverages | ( | VALUE | coverages,
|  | int | mode,
|  | VALUE | me2counter
| ) |  |

Definition at line 5785 of file thread.c.

References COVERAGE_TARGET_BRANCHES, COVERAGE_TARGET_METHODS, Qnil, rb_add_event_hook2(), RUBY_EVENT_CALL, RUBY_EVENT_COVERAGE_BRANCH, RUBY_EVENT_COVERAGE_LINE, RUBY_EVENT_HOOK_FLAG_RAW_ARG, and RUBY_EVENT_HOOK_FLAG_SAFE.

## ◆ rb_sigwait_fd_migrate()

void rb_sigwait_fd_migrate | ( | rb_vm_t * | vm | ) |

Definition at line 1125 of file process.c.

References rb_native_mutex_lock(), rb_native_mutex_unlock(), and rb_vm_struct::waitpid_lock.

Referenced by rb_threadptr_execute_interrupts().

## ◆ rb_thread_alone()

int rb_thread_alone | ( | void |  | ) |

Definition at line 3757 of file thread.c.

References rb_ractor_living_thread_num().

Referenced by rb_thread_stop().

## ◆ rb_thread_atfork()

void rb_thread_atfork | ( | void |  | ) |

Definition at line 4830 of file thread.c.

## ◆ rb_thread_atfork_before_exec()

void rb_thread_atfork_before_exec | ( | void |  | ) |

Definition at line 4835 of file thread.c.

## ◆ rb_thread_call_with_gvl()

void * rb_thread_call_with_gvl | ( | void *(*)(void *) | func,
|  | void * | data1
| ) |  |

Definition at line 1892 of file thread.c.

References rb_unblock_callback::arg, rb_thread_struct::blocking_region_buffer, bp, EXIT_FAILURE, FALSE, rb_unblock_callback::func, if(), rb_bug(), RUBY_ASSERT_ALWAYS, and rb_thread_struct::unblock.

Referenced by ossl_generate_cb_2().

## ◆ rb_thread_call_without_gvl()

void * rb_thread_call_without_gvl | ( | void *(*)(void *data) | func,
|  | void * | data1,
|  | rb_unblock_function_t * | ubf,
|  | void * | data2
| ) |  |

Definition at line 1808 of file thread.c.

References rb_nogvl().

## ◆ rb_thread_call_without_gvl2()

void * rb_thread_call_without_gvl2 | ( | void *(*)(void *) | func,
|  | void * | data1,
|  | rb_unblock_function_t * | ubf,
|  | void * | data2
| ) |  |

Definition at line 1801 of file thread.c.

References rb_nogvl(), and RB_NOGVL_INTR_FAIL.

## ◆ rb_thread_check_ints()

void rb_thread_check_ints | ( | void |  | ) |

Definition at line 1577 of file thread.c.

References RUBY_VM_CHECK_INTS_BLOCKING.

Referenced by rb_io_wait_readable(), and rb_io_wait_writable().

## ◆ rb_thread_check_trap_pending()

int rb_thread_check_trap_pending | ( | void |  | ) |

Definition at line 1587 of file thread.c.

References rb_signal_buff_size().

## ◆ rb_thread_create()

VALUE rb_thread_create | ( | VALUE(*)(void *) | fn,
|  | void * | arg
| ) |  |

Definition at line 1119 of file thread.c.

References thread_create_params::fn, rb_cThread, rb_thread_alloc(), and thread_create_params::type.

## ◆ rb_thread_create_ractor()

VALUE rb_thread_create_ractor | ( | rb_ractor_t * | g,
|  | VALUE | args,
|  | VALUE | proc
| ) |  |

Definition at line 1130 of file thread.c.

References thread_create_params::args, g, thread_create_params::proc, rb_cThread, rb_thread_alloc(), and thread_create_params::type.

## ◆ rb_thread_current()

VALUE rb_thread_current | ( | void |  | ) |

Definition at line 2911 of file thread.c.

Referenced by rb_autoload_load(), rb_f_kill(), VpGetPrecLimit(), and VpGetRoundMode().

## ◆ rb_thread_execute_interrupts()

void rb_thread_execute_interrupts | ( | VALUE | thval | ) |

Definition at line 2525 of file thread.c.

References rb_threadptr_execute_interrupts().

Referenced by rb_f_kill().

## ◆ rb_thread_fd_close()

void rb_thread_fd_close | ( | int | fd | ) |

Definition at line 2634 of file thread.c.

References rb_notify_fd_close(), and rb_thread_schedule().

## ◆ rb_thread_fd_select()

int rb_thread_fd_select | ( | int | max,
|  | rb_fdset_t * | read,
|  | rb_fdset_t * | write,
|  | rb_fdset_t * | except,
|  | struct timeval * | timeout
| ) |  |

Definition at line 4330 of file thread.c.

References rb_thread_struct::ec, select_set::eset, fd_init_copy, max, select_set::max, select_set::orig_rset, rb_ensure(), rb_fd_set, rb_sigwait_fd_get(), rb_thread_sleep_forever(), rb_thread_wait_for(), read(), select_set::rset, RUBY_VM_CHECK_INTS_BLOCKING, select_set::sigwait_fd, select_set::th, select_set::timeout, write(), and select_set::wset.

## ◆ rb_thread_fd_writable()

int rb_thread_fd_writable | ( | int | fd | ) |

Definition at line 4311 of file thread.c.

References TRUE.

Referenced by rb_io_wait_writable().

## ◆ rb_thread_group()

VALUE rb_thread_group | ( | VALUE | thread | ) |

Definition at line 3247 of file thread.c.

References Qnil.

Referenced by Init_Thread().

## ◆ rb_thread_interrupted()

int rb_thread_interrupted | ( | VALUE | thval | ) |

Definition at line 1594 of file thread.c.

References RUBY_VM_INTERRUPTED.

## ◆ rb_thread_io_blocking_region()

VALUE rb_thread_io_blocking_region | ( | rb_blocking_function_t * | func,
|  | void * | data1,
|  | int | fd
| ) |  |

Definition at line 1815 of file thread.c.

References BLOCKING_REGION, COROUTINE_STACK_FREE, COROUTINE_STACK_LOCAL, EC_EXEC_TAG, EC_JUMP_TAG, EC_POP_TAG, EC_PUSH_TAG, FALSE, Qundef, RB_VM_LOCK_ENTER, RB_VM_LOCK_LEAVE, RUBY_VM_CHECK_INTS_BLOCKING, and TAG_NONE.

## ◆ rb_thread_kill()

VALUE rb_thread_kill | ( | VALUE | thread | ) |

Definition at line 2694 of file thread.c.

References eKillSignal, EXIT_SUCCESS, rb_vm_struct::main_thread, PRI_THREAD_ID, rb_vm_struct::ractor, rb_exit(), rb_threadptr_interrupt(), rb_threadptr_pending_interrupt_enque(), thread_debug, thread_id_str, THREAD_KILLED, rb_thread_struct::to_kill, and rb_thread_struct::vm.

Referenced by Init_Thread(), and rb_nogvl().

## ◆ rb_thread_list()

VALUE rb_thread_list | ( | void |  | ) |

Definition at line 2878 of file thread.c.

References rb_ractor_thread_list().

## ◆ rb_thread_local_aref()

VALUE rb_thread_local_aref | ( | VALUE | thread,
|  | ID | id
| ) |  |

Definition at line 3480 of file thread.c.

Referenced by VpGetPrecLimit(), and VpGetRoundMode().

## ◆ rb_thread_local_aset()

VALUE rb_thread_local_aset | ( | VALUE | thread,
|  | ID | id,
|  | VALUE | val
| ) |  |

Definition at line 3628 of file thread.c.

References OBJ_FROZEN, and rb_frozen_error_raise().

Referenced by rb_detach_process().

## ◆ rb_thread_main()

VALUE rb_thread_main | ( | void |  | ) |

Definition at line 2932 of file thread.c.

## ◆ rb_thread_reset_timer_thread()

void rb_thread_reset_timer_thread | ( | void |  | ) |

Definition at line 4696 of file thread.c.

## ◆ rb_thread_run()

VALUE rb_thread_run | ( | VALUE | thread | ) |

Definition at line 2835 of file thread.c.

References rb_thread_schedule(), and rb_thread_wakeup().

Referenced by Init_Thread().

## ◆ rb_thread_schedule()

void rb_thread_schedule | ( | void |  | ) |

Definition at line 1623 of file thread.c.

References RUBY_VM_CHECK_INTS.

Referenced by rb_thread_fd_close(), and rb_thread_run().

## ◆ rb_thread_shield_destroy()

VALUE rb_thread_shield_destroy | ( | VALUE | self | ) |

Definition at line 5128 of file thread.c.

References DATA_PTR, Qfalse, Qtrue, and rb_mutex_unlock().

## ◆ rb_thread_shield_new()

VALUE rb_thread_shield_new | ( | void |  | ) |

Definition at line 5072 of file thread.c.

References DATA_PTR, and rb_mutex_lock().

## ◆ rb_thread_shield_release()

VALUE rb_thread_shield_release | ( | VALUE | self | ) |

Definition at line 5117 of file thread.c.

References Qfalse, Qtrue, and rb_mutex_unlock().

## ◆ rb_thread_shield_wait()

VALUE rb_thread_shield_wait | ( | VALUE | self | ) |

Definition at line 5088 of file thread.c.

References DATA_PTR, rb_mutex_struct::fiber, GetThreadShieldPtr, Qfalse, Qnil, Qtrue, rb_mutex_lock(), and rb_mutex_unlock().

## ◆ rb_thread_sleep()

void rb_thread_sleep | ( | int | sec | ) |

Definition at line 1600 of file thread.c.

References INT2FIX, rb_thread_wait_for(), and rb_time_timeval().

## ◆ rb_thread_sleep_deadly()

void rb_thread_sleep_deadly | ( | void |  | ) |

Definition at line 1531 of file thread.c.

References SLEEP_DEADLOCKABLE, SLEEP_SPURIOUS_CHECK, and thread_debug.

Referenced by rb_thread_stop().

## ◆ rb_thread_sleep_forever()

void rb_thread_sleep_forever | ( | void |  | ) |

Definition at line 1524 of file thread.c.

References SLEEP_SPURIOUS_CHECK, and thread_debug.

Referenced by rb_thread_fd_select().

## ◆ rb_thread_sleep_interruptible()

void rb_thread_sleep_interruptible | ( | void |  | ) |

Definition at line 1538 of file thread.c.

References rb_thread_struct::ec, RUBY_VM_CHECK_INTS_BLOCKING, and THREAD_STOPPED.

## ◆ rb_thread_start_timer_thread()

void rb_thread_start_timer_thread | ( | void |  | ) |

Definition at line 4702 of file thread.c.

## ◆ rb_thread_stop()

VALUE rb_thread_stop | ( | void |  | ) |

Definition at line 2844 of file thread.c.

References Qnil, rb_eThreadError, rb_raise(), rb_thread_alone(), and rb_thread_sleep_deadly().

## ◆ rb_thread_stop_timer_thread()

void rb_thread_stop_timer_thread | ( | void |  | ) |

Definition at line 4688 of file thread.c.

## ◆ 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_thread_to_be_killed()

int rb_thread_to_be_killed | ( | VALUE | thread | ) |

Definition at line 2720 of file thread.c.

References FALSE, THREAD_KILLED, rb_thread_struct::to_kill, and TRUE.

## ◆ rb_thread_wait_fd()

void rb_thread_wait_fd | ( | int | fd | ) |

Definition at line 4305 of file thread.c.

Referenced by rb_io_read_check(), and rb_io_wait_readable().

## ◆ rb_thread_wait_for()

void rb_thread_wait_for | ( | struct timeval | time | ) |

Definition at line 1562 of file thread.c.

References SLEEP_SPURIOUS_CHECK.

Referenced by rb_thread_fd_select(), and rb_thread_sleep().

## ◆ rb_thread_wait_for_single_fd()

int rb_thread_wait_for_single_fd | ( | int | fd,
|  | int | events,
|  | struct timeval * | timeout
| ) |  |

Definition at line 4551 of file thread.c.

References select_args::as, select_args::error, select_args::except, waiting_fd::fd, select_args::fd, int(), NULL, ptr, rb_ensure(), RB_VM_LOCK_ENTER, RB_VM_LOCK_LEAVE, RB_WAITFD_IN, RB_WAITFD_OUT, RB_WAITFD_PRI, select_args::read, waiting_fd::th, select_args::timeout, select_args::tv, rb_thread_struct::vm, rb_vm_struct::waiting_fds, select_args::wfd, waiting_fd::wfd_node, and select_args::write.

Referenced by rb_io_wait(), and rb_wait_for_single_fd().

## ◆ rb_thread_wakeup()

VALUE rb_thread_wakeup | ( | VALUE | thread | ) |

Definition at line 2788 of file thread.c.

References rb_eThreadError, rb_raise(), rb_thread_wakeup_alive(), and RTEST.

Referenced by Init_Thread(), and rb_thread_run().

## ◆ rb_thread_wakeup_alive()

VALUE rb_thread_wakeup_alive | ( | VALUE | thread | ) |

Definition at line 2797 of file thread.c.

References Qnil, THREAD_KILLED, THREAD_RUNNABLE, THREAD_STOPPED, and THREAD_STOPPED_FOREVER.

Referenced by rb_thread_wakeup().

## ◆ rb_threadptr_check_signal()

void rb_threadptr_check_signal | ( | rb_thread_t * | mth | ) |

Definition at line 4598 of file thread.c.

References rb_signal_buff_size().

Referenced by rb_f_kill().

## ◆ rb_threadptr_execute_interrupts()

int rb_threadptr_execute_interrupts | ( | rb_thread_t * | th,
|  | int | blocking_timing
| ) |  |

Definition at line 2424 of file thread.c.

References rb_execution_context_struct::cfp, rb_thread_struct::ec, eKillSignal, err, eTerminateSignal, EXEC_EVENT_HOOK, FALSE, INT2FIX, INTERRUPT_NONE, INTERRUPT_ON_BLOCKING, rb_vm_struct::main_thread, PENDING_INTERRUPT_MASK, POSTPONED_JOB_INTERRUPT_MASK, rb_blocking_region_buffer::prev_status, PRIdVALUE, rb_thread_struct::priority, Qundef, rb_vm_struct::ractor, rb_execution_context_struct::raised_flag, rb_exc_raise(), rb_get_next_signal(), rb_postponed_job_flush(), rb_signal_exec(), rb_sigwait_fd_get(), rb_sigwait_fd_migrate(), rb_sigwait_fd_put(), RB_VM_LOCK_ENTER, RB_VM_LOCK_LEAVE, ruby_error_stream_closed, RUBY_INTERNAL_EVENT_SWITCH, ruby_sigchld_handler(), ruby_vm_special_exception_copy(), rb_thread_struct::running_time_us, rb_control_frame_struct::self, rb_vm_struct::special_exceptions, TAG_FATAL, TERMINATE_INTERRUPT_MASK, thread_debug, THREAD_RUNNABLE, THREAD_STOPPED, THREAD_STOPPED_FOREVER, TIMER_INTERRUPT_MASK, TRAP_INTERRUPT_MASK, TRUE, rb_thread_struct::vm, VM_ASSERT, and VM_BARRIER_INTERRUPT_MASK.

Referenced by rb_thread_execute_interrupts().

## ◆ rb_threadptr_interrupt()

void rb_threadptr_interrupt | ( | rb_thread_t * | th | ) |

Definition at line 508 of file thread.c.

Referenced by rb_notify_fd_close(), rb_ractor_terminate_interrupt_main_thread(), and rb_thread_kill().

## ◆ rb_threadptr_pending_interrupt_clear()

void rb_threadptr_pending_interrupt_clear | ( | rb_thread_t * | th | ) |

Definition at line 1981 of file thread.c.

References rb_thread_struct::pending_interrupt_queue, and rb_ary_clear().

## ◆ rb_threadptr_pending_interrupt_enque()

void rb_threadptr_pending_interrupt_enque | ( | rb_thread_t * | th,
|  | VALUE | v
| ) |  |

Definition at line 1987 of file thread.c.

References rb_thread_struct::pending_interrupt_queue, rb_thread_struct::pending_interrupt_queue_checked, and rb_ary_push().

Referenced by rb_fiber_start(), rb_notify_fd_close(), and rb_thread_kill().

## ◆ rb_threadptr_root_fiber_terminate()

void rb_threadptr_root_fiber_terminate | ( | rb_thread_t * | th | ) |

Definition at line 2130 of file cont.c.

References rb_thread_struct::ec, rb_execution_context_struct::fiber_ptr, FIBER_TERMINATED, and rb_ec_clear_vm_stack().

## ◆ rb_threadptr_signal_exit()

void rb_threadptr_signal_exit | ( | rb_thread_t * | th | ) |

Definition at line 2575 of file thread.c.

References argv, rb_vm_struct::main_thread, rb_vm_struct::ractor, rb_eSystemExit, rb_str_new2, and rb_thread_struct::vm.

Referenced by rb_signal_exec().

## ◆ rb_threadptr_signal_raise()

void rb_threadptr_signal_raise | ( | rb_thread_t * | th,
|  | int | sig
| ) |  |

Definition at line 2565 of file thread.c.

References argv, INT2FIX, rb_vm_struct::main_thread, rb_vm_struct::ractor, rb_eSignal, and rb_thread_struct::vm.

Referenced by rb_signal_exec().

## ◆ rb_threadptr_unlock_all_locking_mutexes()

void rb_threadptr_unlock_all_locking_mutexes | ( | rb_thread_t * | th | ) |

Definition at line 567 of file thread.c.

References rb_mutex_struct::fiber, rb_thread_struct::keeping_mutexes, rb_mutex_struct::next_mutex, and rb_bug().

Referenced by rb_thread_terminate_all().

## ◆ rb_uninterruptible()

VALUE rb_uninterruptible | ( | VALUE(*)(VALUE) | b_proc,
|  | VALUE | data
| ) |  |

Definition at line 5874 of file thread.c.

References rb_thread_struct::ec, OBJ_FREEZE_RAW, rb_thread_struct::pending_interrupt_mask_stack, Qnil, rb_ary_push(), rb_cObject, rb_ensure(), rb_hash_aset(), rb_ident_hash_new(), and RUBY_VM_CHECK_INTS.

## ◆ rb_vm_check_ints_blocking()

int rb_vm_check_ints_blocking | ( | rb_execution_context_t * | ec | ) |

Definition at line 222 of file thread.c.

## ◆ rb_vm_gvl_destroy()

void rb_vm_gvl_destroy | ( | rb_global_vm_lock_t * | gvl | ) |

Definition at line 423 of file thread.c.

## ◆ rb_vm_invoke_proc_with_self()

VALUE rb_vm_invoke_proc_with_self | ( | rb_execution_context_t * | ec,
|  | rb_proc_t * | proc,
|  | VALUE | self,
|  | int | argc,
|  | const VALUE * | argv,
|  | int | kw_splat,
|  | VALUE | passed_block_handler
| ) |  |

Definition at line 1490 of file vm.c.

References argc, argv, NULL, rb_block::proc, and rb_vm_invoke_bmethod().

## ◆ rb_vm_proc_local_ep()

const VALUE * rb_vm_proc_local_ep | ( | VALUE | proc | ) |

Definition at line 675 of file thread.c.

References NULL, and rb_vm_ep_local_ep().

Referenced by rb_fiber_start().

## ◆ ruby_native_thread_p()

int ruby_native_thread_p | ( | void |  | ) |

Definition at line 5564 of file thread.c.

## ◆ ruby_sigchld_handler()

void ruby_sigchld_handler | ( | rb_vm_t * | vm | ) |

Definition at line 1090 of file signal.c.

References GET_SIGCHLD_HIT, ruby_waitpid_all(), and SIGCHLD_LOSSY.

Referenced by rb_threadptr_execute_interrupts().

## ◆ ruby_thread_has_gvl_p()

int ruby_thread_has_gvl_p | ( | void |  | ) |

Definition at line 1935 of file thread.c.

References rb_thread_struct::blocking_region_buffer.

Referenced by rb_fatal(), and ruby_waitpid_locked().

## ◆ ruby_thread_init_stack()

void ruby_thread_init_stack | ( | rb_thread_t * | th | ) |

Definition at line 669 of file thread.c.

Referenced by Init_BareVM().

## ◆ STATIC_ASSERT()

STATIC_ASSERT | ( | THREAD_SHIELD_WAITING_MAX | ,
|  | THREAD_SHIELD_WAITING_MAX<= | UINT_MAX
| ) |  |