mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
rb_ext_ractor_safe() to declare ractor-safe ext
C extensions can violate the ractor-safety, so only ractor-safe C extensions (C methods) can run on non-main ractors. rb_ext_ractor_safe(true) declares that the successive defined methods are ractor-safe. Otherwiwze, defined methods checked they are invoked in main ractor and raise an error if invoked at non-main ractors. [Feature #17307]
This commit is contained in:
parent
8247b8edde
commit
182fb73c40
Notes:
git
2020-12-01 15:44:43 +09:00
7 changed files with 267 additions and 35 deletions
|
@ -34,6 +34,10 @@ void rb_provide(const char*);
|
|||
VALUE rb_f_require(VALUE, VALUE);
|
||||
VALUE rb_require_string(VALUE);
|
||||
|
||||
// extension configuration
|
||||
void rb_ext_ractor_safe(bool flag);
|
||||
#define RB_EXT_RACTOR_SAFE(f) rb_ext_ractor_safe(f)
|
||||
|
||||
RBIMPL_SYMBOL_EXPORT_END()
|
||||
|
||||
#endif /* RBIMPL_INTERN_LOAD_H */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue