Ruby: internal/thread.h Source File

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

thread.h
Go to the documentation of this file.
1#ifndef INTERNAL_THREAD_H /*-*-C-*-vi:se ft=c:*/
2#define INTERNAL_THREAD_H
12#include "ruby/ruby.h" /* for VALUE */
13#include "ruby/intern.h" /* for rb_blocking_function_t */
14
15struct rb_thread_struct; /* in vm_core.h */
16
17/* thread.c */
18#define COVERAGE_INDEX_LINES 0
19#define COVERAGE_INDEX_BRANCHES 1
20#define COVERAGE_TARGET_LINES 1
21#define COVERAGE_TARGET_BRANCHES 2
22#define COVERAGE_TARGET_METHODS 4
23#define COVERAGE_TARGET_ONESHOT_LINES 8
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);
32 VALUE rb_thread_shield_wait(VALUE self);
33 VALUE rb_thread_shield_release(VALUE self);
34 VALUE rb_thread_shield_destroy(VALUE self);
35int rb_thread_to_be_killed(VALUE thread);
36void rb_mutex_allow_trap(VALUE self, int val);
37 VALUE rb_uninterruptible(VALUE (*b_proc)(VALUE), VALUE data);
38 VALUE rb_mutex_owned_p(VALUE self);
39
40int rb_thread_wait_for_single_fd(int fd, int events, struct timeval * timeout);
41
42RUBY_SYMBOL_EXPORT_BEGIN
43/* Temporary. This API will be removed (renamed). */
44 VALUE rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd);
45
46/* thread.c (export) */
47int ruby_thread_has_gvl_p(void); /* for ext/fiddle/closure.c */
48RUBY_SYMBOL_EXPORT_END
49
50 MJIT_SYMBOL_EXPORT_BEGIN
51int rb_threadptr_execute_interrupts(struct rb_thread_struct *th, int blocking_timing);
52 MJIT_SYMBOL_EXPORT_END
53
54#endif /* INTERNAL_THREAD_H */
MJIT_SYMBOL_EXPORT_END
#define MJIT_SYMBOL_EXPORT_END
Definition: dllexport.h:63
MJIT_SYMBOL_EXPORT_BEGIN
#define MJIT_SYMBOL_EXPORT_BEGIN
Definition: dllexport.h:62
rb_blocking_function_t
VALUE rb_blocking_function_t(void *)
Definition: thread.h:60
intern.h
rb_get_coverages
VALUE rb_get_coverages(void)
Definition: thread.c:5773
rb_mutex_allow_trap
void rb_mutex_allow_trap(VALUE self, int val)
Definition: thread_sync.c:621
ruby_thread_has_gvl_p
int ruby_thread_has_gvl_p(void)
Definition: thread.c:1935
rb_threadptr_execute_interrupts
int rb_threadptr_execute_interrupts(struct rb_thread_struct *th, int blocking_timing)
Definition: thread.c:2424
rb_mutex_owned_p
VALUE rb_mutex_owned_p(VALUE self)
Definition: thread_sync.c:414
rb_suppress_tracing
VALUE rb_suppress_tracing(VALUE(*func)(VALUE), VALUE arg)
Definition: vm_trace.c:418
rb_thread_to_be_killed
int rb_thread_to_be_killed(VALUE thread)
Definition: thread.c:2720
rb_thread_shield_new
VALUE rb_thread_shield_new(void)
Definition: thread.c:5072
rb_thread_shield_destroy
VALUE rb_thread_shield_destroy(VALUE self)
Definition: thread.c:5128
rb_uninterruptible
VALUE rb_uninterruptible(VALUE(*b_proc)(VALUE), VALUE data)
Definition: thread.c:5874
rb_thread_shield_wait
VALUE rb_thread_shield_wait(VALUE self)
Definition: thread.c:5088
rb_default_coverage
VALUE rb_default_coverage(int)
Definition: thread.c:5815
rb_thread_shield_release
VALUE rb_thread_shield_release(VALUE self)
Definition: thread.c:5117
rb_get_coverage_mode
int rb_get_coverage_mode(void)
Definition: thread.c:5779
rb_obj_is_mutex
VALUE rb_obj_is_mutex(VALUE obj)
Definition: thread_sync.c:142
rb_thread_execute_interrupts
void rb_thread_execute_interrupts(VALUE th)
Definition: thread.c:2525
rb_thread_io_blocking_region
VALUE rb_thread_io_blocking_region(rb_blocking_function_t *func, void *data1, int fd)
Definition: thread.c:1815
rb_thread_wait_for_single_fd
int rb_thread_wait_for_single_fd(int fd, int events, struct timeval *timeout)
Definition: thread.c:4551
ruby.h
rb_thread_struct
Definition: vm_core.h:935
rb_thread_struct::func
VALUE(* func)(void *)
Definition: vm_core.h:996
rb_thread_struct::self
VALUE self
Definition: vm_core.h:937
rb_thread_struct::arg
void * arg
Definition: vm_core.h:997
timeval
Definition: missing.h:51
VALUE
unsigned long VALUE
Definition: value.h:38