Ruby  3.1.4p223 (2023-03-30 revision HEAD)
thread.h
Go to the documentation of this file.
1 #ifndef RUBY_THREAD_H /*-*-C++-*-vi:se ft=cpp:*/
2 #define RUBY_THREAD_H 1
14 #include "ruby/internal/intern/thread.h" /* rb_unblock_function_t */
16 
48 #define RB_NOGVL_INTR_FAIL (0x1)
49 
60 #define RB_NOGVL_UBF_ASYNC_SAFE (0x2)
61 
65 
91 void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
92 
130 void *rb_thread_call_without_gvl(void *(*func)(void *), void *data1,
131  rb_unblock_function_t *ubf, void *data2);
132 
154 void *rb_thread_call_without_gvl2(void *(*func)(void *), void *data1,
155  rb_unblock_function_t *ubf, void *data2);
156 
157 /*
158  * XXX: unstable/unapproved - out-of-tree code should NOT not depend
159  * on this until it hits Ruby 2.6.1
160  */
161 
174 void *rb_nogvl(void *(*func)(void *), void *data1,
175  rb_unblock_function_t *ubf, void *data2,
176  int flags);
177 
185 #define RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS_AFTER 0x01
186 
191 #define RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS_
192 
194 
195 #endif /* RUBY_THREAD_H */
Tweaking visibility of C variables/functions.
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition: dllexport.h:106
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition: dllexport.h:97
Public APIs related to rb_cThread.
void rb_unblock_function_t(void *)
This is the type of UBFs.
Definition: thread.h:336
void * rb_thread_call_without_gvl2(void *(*func)(void *), void *data1, rb_unblock_function_t *ubf, void *data2)
Identical to rb_thread_call_without_gvl(), except it does not interface with signals etc.
Definition: thread.c:1797
void * rb_thread_call_with_gvl(void *(*func)(void *), void *data1)
(Re-)acquires the GVL.
Definition: thread.c:1888
void * rb_nogvl(void *(*func)(void *), void *data1, rb_unblock_function_t *ubf, void *data2, int flags)
Identical to rb_thread_call_without_gvl(), except it additionally takes "flags" that change the behav...
Definition: thread.c:1666
void * rb_thread_call_without_gvl(void *(*func)(void *), void *data1, rb_unblock_function_t *ubf, void *data2)
Allows the passed function to run in parallel with other Ruby threads.
Defines RBIMPL_ATTR_NONNULL.
#define RBIMPL_ATTR_NONNULL(list)
Wraps (or simulates) __attribute__((nonnull))
Definition: nonnull.h:27