diff options
author | Koichi Sasada <ko1@atdot.net> | 2020-12-02 03:37:56 +0900 |
---|---|---|
committer | Koichi Sasada <ko1@atdot.net> | 2020-12-07 08:28:36 +0900 |
commit | b67b24d0f5e78481e6a306881b6858f0dec996ba (patch) | |
tree | 178f1e37077ded7eb9bae6d2d2031a22a98f43f0 /ractor_core.h | |
parent | 60eabb1aa7d1d8ab83c49916bd8c3536daf5d03b (diff) |
ruby_single_main_ractor for single ractor mode
ruby_multi_ractor was a flag that indicates the interpreter doesn't
make any additional ractors (single ractor mode).
Instead of boolean flag, ruby_single_main_ractor pointer is introduced
which keeps main ractor's pointer if single ractor mode. If additional
ractors are created, ruby_single_main_ractor becomes NULL.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3842
Diffstat (limited to 'ractor_core.h')
-rw-r--r-- | ractor_core.h | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/ractor_core.h b/ractor_core.h index b0295155ac..9f87f15e55 100644 --- a/ractor_core.h +++ b/ractor_core.h @@ -176,12 +176,10 @@ void rb_ractor_local_storage_delkey(rb_ractor_local_key_t key); RUBY_SYMBOL_EXPORT_END -RUBY_EXTERN bool ruby_multi_ractor; - static inline bool rb_ractor_main_p(void) { - if (!ruby_multi_ractor) { + if (ruby_single_main_ractor) { return true; } else { |