Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)
|
Public APIs related to rb_cThread. More...
#include "ruby/internal/config.h"
#include "ruby/internal/cast.h"
#include "ruby/internal/dllexport.h"
#include "ruby/internal/value.h"
Go to the source code of this file.
Macros | |
#define | RUBY_UBF_IO RBIMPL_CAST((rb_unblock_function_t *)-1) |
#define | RUBY_UBF_PROCESS RBIMPL_CAST((rb_unblock_function_t *)-1) |
Typedefs | |
typedef void | rb_unblock_function_t(void *) |
typedef VALUE | rb_blocking_function_t(void *) |
Public APIs related to rb_cThread.
RBIMPL
or rbimpl
are implementation details. Don't take them as canon. They could rapidly appear then vanish. The name (path) of this header file is also an implementation detail. Do not expect it to persist at the place it is now. Developers are free to move it anywhere anytime at will. __VA_ARGS__
is always available. We assume C99 for ruby itself but we don't assume languages of extension libraries. They could be written in C++98. Definition in file thread.h.
#define RUBY_UBF_IO RBIMPL_CAST((rb_unblock_function_t *)-1) |
#define RUBY_UBF_PROCESS RBIMPL_CAST((rb_unblock_function_t *)-1) |
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().
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().
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().
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().
Definition at line 402 of file thread_sync.c.
References sync_waiter::self.
Referenced by rb_mutex_synchronize(), rb_thread_shield_new(), and rb_thread_shield_wait().
Definition at line 189 of file thread_sync.c.
References rb_mutex_struct::fiber, Qfalse, Qtrue, and sync_waiter::self.
VALUE rb_mutex_new | ( | void | ) |
Definition at line 177 of file thread_sync.c.
Definition at line 537 of file thread_sync.c.
References NIL_P, Qnil, rb_ensure(), rb_mutex_unlock(), rb_scheduler_current(), rb_scheduler_kernel_sleep(), rb_time_interval(), RUBY_VM_CHECK_INTS_BLOCKING, and t.
Definition at line 598 of file thread_sync.c.
References rb_ensure(), rb_mutex_lock(), and rb_mutex_unlock().
Definition at line 236 of file thread_sync.c.
References rb_mutex_struct::fiber, sync_waiter::fiber, Qfalse, Qtrue, sync_waiter::self, and sync_waiter::th.
Definition at line 474 of file thread_sync.c.
References err, rb_eThreadError, rb_raise(), sync_waiter::self, and sync_waiter::th.
Referenced by rb_mutex_sleep(), rb_mutex_synchronize(), rb_thread_shield_destroy(), rb_thread_shield_release(), and rb_thread_shield_wait().
int rb_thread_alone | ( | void | ) |
Definition at line 3757 of file thread.c.
References rb_ractor_living_thread_num().
Referenced by rb_thread_stop().
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().
Definition at line 1119 of file thread.c.
References thread_create_params::fn, rb_cThread, rb_thread_alloc(), and thread_create_params::type.
VALUE rb_thread_current | ( | void | ) |
Definition at line 2911 of file thread.c.
Referenced by rb_autoload_load(), rb_f_kill(), VpGetPrecLimit(), and VpGetRoundMode().
void rb_thread_fd_close | ( | int | fd | ) |
Definition at line 2634 of file thread.c.
References rb_notify_fd_close(), and rb_thread_schedule().
Definition at line 1594 of file thread.c.
References RUBY_VM_INTERRUPTED.
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().
Definition at line 3480 of file thread.c.
Referenced by VpGetPrecLimit(), and VpGetRoundMode().
Definition at line 3628 of file thread.c.
References OBJ_FROZEN, and rb_frozen_error_raise().
Referenced by rb_detach_process().
Definition at line 2835 of file thread.c.
References rb_thread_schedule(), and rb_thread_wakeup().
Referenced by Init_Thread().
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().
void rb_thread_sleep | ( | int | sec | ) |
Definition at line 1600 of file thread.c.
References INT2FIX, rb_thread_wait_for(), and rb_time_timeval().
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().
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().
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().
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().
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().
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().
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().