Ruby: include/ruby/thread.h Source File

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

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
13#include "ruby/intern.h"
14#include "ruby/internal/dllexport.h"
15
16/* flags for rb_nogvl */
17#define RB_NOGVL_INTR_FAIL (0x1)
18#define RB_NOGVL_UBF_ASYNC_SAFE (0x2)
19
20 RBIMPL_SYMBOL_EXPORT_BEGIN()
21
22void *rb_thread_call_with_gvl(void *(*func)(void *), void *data1);
23
24 void *rb_thread_call_without_gvl(void *(*func)(void *), void *data1,
25 rb_unblock_function_t *ubf, void *data2);
26void *rb_thread_call_without_gvl2(void *(*func)(void *), void *data1,
27 rb_unblock_function_t *ubf, void *data2);
28
29/*
30 * XXX: unstable/unapproved - out-of-tree code should NOT not depend
31 * on this until it hits Ruby 2.6.1
32 */
33void *rb_nogvl(void *(*func)(void *), void *data1,
34 rb_unblock_function_t *ubf, void *data2,
35 int flags);
36
37#define RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS_AFTER 0x01
38#define RUBY_CALL_WO_GVL_FLAG_SKIP_CHECK_INTS_
39
40 RBIMPL_SYMBOL_EXPORT_END()
41
42#endif /* RUBY_THREAD_H */
dllexport.h
Tewaking visibility of C variables/functions.
RBIMPL_SYMBOL_EXPORT_END
#define RBIMPL_SYMBOL_EXPORT_END()
Counterpart of RBIMPL_SYMBOL_EXPORT_BEGIN.
Definition: dllexport.h:86
RBIMPL_SYMBOL_EXPORT_BEGIN
#define RBIMPL_SYMBOL_EXPORT_BEGIN()
Shortcut macro equivalent to RUBY_SYMBOL_EXPORT_BEGIN extern "C" {.
Definition: dllexport.h:77
rb_unblock_function_t
void rb_unblock_function_t(void *)
Definition: thread.h:59
rb_nogvl
void * rb_nogvl(void *(*func)(void *), void *data1, rb_unblock_function_t *ubf, void *data2, int flags)
Definition: thread.c:1670
rb_thread_call_with_gvl
void * rb_thread_call_with_gvl(void *(*func)(void *), void *data1)
Definition: thread.c:1892
rb_thread_call_without_gvl2
void * rb_thread_call_without_gvl2(void *(*func)(void *), void *data1, rb_unblock_function_t *ubf, void *data2)
Definition: thread.c:1801
rb_thread_call_without_gvl
void * rb_thread_call_without_gvl(void *(*func)(void *), void *data1, rb_unblock_function_t *ubf, void *data2)
intern.h