diff options
author | Koichi Sasada <[email protected]> | 2021-01-06 15:30:56 +0900 |
---|---|---|
committer | Koichi Sasada <[email protected]> | 2021-01-06 16:03:09 +0900 |
commit | d968829afa19c31e9461fd545cbd21250778ce6e (patch) | |
tree | 8660cc24f35fa3cf3744818cef3569355cb3d51a /include | |
parent | d9fdca81ac0e4e98314b385b2f245951aaccd50c (diff) |
expose some C-APIs for ractor
expose some C-APIs to try to make ractor utilities on external gems.
* add
* rb_ractor_local_storage_value_lookup() to check availability
* expose
* rb_ractor_make_shareable()
* rb_ractor_make_shareable_copy()
* rb_proc_isolate() (not public)
* rb_proc_isolate_bang() (not public)
* rb_proc_ractor_make_shareable() (not public)
Diffstat (limited to 'include')
-rw-r--r-- | include/ruby/ractor.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/include/ruby/ractor.h b/include/ruby/ractor.h index 239df9c04c..1d6687456c 100644 --- a/include/ruby/ractor.h +++ b/include/ruby/ractor.h @@ -32,6 +32,7 @@ void rb_ractor_stderr_set(VALUE); rb_ractor_local_key_t rb_ractor_local_storage_value_newkey(void); VALUE rb_ractor_local_storage_value(rb_ractor_local_key_t key); +bool rb_ractor_local_storage_value_lookup(rb_ractor_local_key_t key, VALUE *val); void rb_ractor_local_storage_value_set(rb_ractor_local_key_t key, VALUE val); RUBY_EXTERN const struct rb_ractor_local_storage_type rb_ractor_local_storage_type_free; @@ -41,6 +42,9 @@ rb_ractor_local_key_t rb_ractor_local_storage_ptr_newkey(const struct rb_ractor_ void *rb_ractor_local_storage_ptr(rb_ractor_local_key_t key); void rb_ractor_local_storage_ptr_set(rb_ractor_local_key_t key, void *ptr); +VALUE rb_ractor_make_shareable(VALUE obj); +VALUE rb_ractor_make_shareable_copy(VALUE obj); + RUBY_SYMBOL_EXPORT_END #define RB_OBJ_SHAREABLE_P(obj) FL_TEST_RAW((obj), RUBY_FL_SHAREABLE) @@ -61,7 +65,4 @@ rb_ractor_shareable_p(VALUE obj) } } -VALUE rb_ractor_make_shareable(VALUE obj); -VALUE rb_ractor_make_shareable_copy(VALUE obj); - #endif /* RUBY_RACTOR_H */ |