2 #define RUBY_THREAD_H 1
48 #define RB_NOGVL_INTR_FAIL (0x1)
60 #define RB_NOGVL_UBF_ASYNC_SAFE (0x2)
174 void *
rb_nogvl(
void *(*func)(
void *),
void *data1,
185 #define RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS_AFTER 0x01
191 #define RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS_
211 #define RUBY_INTERNAL_THREAD_EVENT_STARTED 1 << 0
218 #define RUBY_INTERNAL_THREAD_EVENT_READY 1 << 1
225 #define RUBY_INTERNAL_THREAD_EVENT_RESUMED 1 << 2
232 #define RUBY_INTERNAL_THREAD_EVENT_SUSPENDED 1 << 3
239 #define RUBY_INTERNAL_THREAD_EVENT_EXITED 1 << 4
241 #define RUBY_INTERNAL_THREAD_EVENT_MASK 0xff
247 typedef void (*rb_internal_thread_event_callback)(
rb_event_flag_t event,
250 typedef struct rb_internal_thread_event_hook rb_internal_thread_event_hook_t;
281 rb_internal_thread_event_hook_t * hook);
284 typedef int rb_internal_thread_specific_key_t;
285 #define RB_INTERNAL_THREAD_SPECIFIC_KEY_MAX 8
Tweaking visibility of C variables/functions.
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
uint32_t rb_event_flag_t
Represents event(s).
Public APIs related to rb_cThread.
void rb_unblock_function_t(void *)
This is the type of UBFs.
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.
void * rb_internal_thread_specific_get(VALUE thread_val, rb_internal_thread_specific_key_t key)
Get thread and tool specific data.
void rb_internal_thread_specific_set(VALUE thread_val, rb_internal_thread_specific_key_t key, void *data)
Set thread and tool specific data.
rb_internal_thread_specific_key_t rb_internal_thread_specific_key_create(void)
Create a key to store thread specific data.
void * rb_thread_call_with_gvl(void *(*func)(void *), void *data1)
(Re-)acquires the GVL.
rb_internal_thread_event_hook_t * rb_internal_thread_add_event_hook(rb_internal_thread_event_callback func, rb_event_flag_t events, void *data)
Registers a thread event hook function.
bool rb_thread_lock_native_thread(void)
Declare the current Ruby thread should acquire a dedicated native thread on M:N thread scheduler.
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...
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.
bool rb_internal_thread_remove_event_hook(rb_internal_thread_event_hook_t *hook)
Unregister the passed hook.
Defines RBIMPL_ATTR_NONNULL.
#define RBIMPL_ATTR_NONNULL(list)
Wraps (or simulates) __attribute__((nonnull))
uintptr_t VALUE
Type that represents a Ruby object.