diff options
author | Koichi Sasada <[email protected]> | 2020-11-26 04:25:42 +0900 |
---|---|---|
committer | Koichi Sasada <[email protected]> | 2020-11-27 17:03:30 +0900 |
commit | 2db2fb9f6c742d5bd0019ccd11c7a375e1b12c0b (patch) | |
tree | e5f464004a386e2838a700ad5cced540e8f9953c /ractor_core.h | |
parent | 8ce1711c255679d38b6a2405ff694eb5b5b2eae5 (diff) |
per-ractor Random::DEFAULT
Random generators are not Ractor-safe, so we need to prepare
per-ractor default random genearators. This patch set
`Random::DEFAULT = Randm` (not a Random instance, but the Random
class) and singleton methods like `Random.rand()` use a per-ractor
random generator.
[Feature #17322]
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/3813
Diffstat (limited to 'ractor_core.h')
-rw-r--r-- | ractor_core.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ractor_core.h b/ractor_core.h index 07528cc69c..dd662141a0 100644 --- a/ractor_core.h +++ b/ractor_core.h @@ -127,6 +127,8 @@ struct rb_ractor_struct { VALUE verbose; VALUE debug; + void *default_rand; // used in random.c + // gc.c rb_objspace_reachable_objects_from struct gc_mark_func_data_struct { void *data; |