Ruby: internal/thread.h Source File

Ruby 3.2.5p208 (2024-07-26 revision 31d0f1a2e7dbfb60731d1f05b868e1d578cda493)

thread.h
1#ifndef INTERNAL_THREAD_H /*-*-C-*-vi:se ft=c:*/
2#define INTERNAL_THREAD_H
11#include "ruby/ruby.h" /* for VALUE */
12#include "ruby/intern.h" /* for rb_blocking_function_t */
13
14struct rb_thread_struct; /* in vm_core.h */
15
16/* thread.c */
17#define COVERAGE_INDEX_LINES 0
18#define COVERAGE_INDEX_BRANCHES 1
19#define COVERAGE_TARGET_LINES 1
20#define COVERAGE_TARGET_BRANCHES 2
21#define COVERAGE_TARGET_METHODS 4
22#define COVERAGE_TARGET_ONESHOT_LINES 8
23#define COVERAGE_TARGET_EVAL 16
24
25 VALUE rb_obj_is_mutex(VALUE obj);
26 VALUE rb_suppress_tracing(VALUE (*func)(VALUE), VALUE arg);
27void rb_thread_execute_interrupts(VALUE th);
28 VALUE rb_get_coverages(void);
29int rb_get_coverage_mode(void);
30 VALUE rb_default_coverage(int);
31 VALUE rb_thread_shield_new(void);
32bool rb_thread_shield_owned(VALUE self);
33 VALUE rb_thread_shield_wait(VALUE self);
34 VALUE rb_thread_shield_release(VALUE self);
35 VALUE rb_thread_shield_destroy(VALUE self);
36int rb_thread_to_be_killed(VALUE thread);
37void rb_mutex_allow_trap(VALUE self, int val);
38 VALUE rb_uninterruptible(VALUE (*b_proc)(VALUE), VALUE data);
39 VALUE rb_mutex_owned_p(VALUE self);
40 VALUE rb_exec_recursive_outer_mid(VALUE (*f)(VALUE g, VALUE h, int r), VALUE g, VALUE h, ID mid);
41
42int rb_thread_wait_for_single_fd(int fd, int events, struct timeval * timeout);
43
44RUBY_SYMBOL_EXPORT_BEGIN
45/* Temporary. This API will be removed (renamed). */
46 VALUE rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd);
47
48/* thread.c (export) */
49int ruby_thread_has_gvl_p(void); /* for ext/fiddle/closure.c */
50RUBY_SYMBOL_EXPORT_END
51
52MJIT_SYMBOL_EXPORT_BEGIN
53int rb_threadptr_execute_interrupts(struct rb_thread_struct *th, int blocking_timing);
54MJIT_SYMBOL_EXPORT_END
55
56#endif /* INTERNAL_THREAD_H */
intern.h
ruby.h
rb_thread_struct
Definition vm_core.h:984
timeval
Definition missing.h:63
ID
uintptr_t ID
Type that represents a Ruby identifier such as a variable name.
Definition value.h:52
VALUE
uintptr_t VALUE
Type that represents a Ruby object.
Definition value.h:40