aboutsummaryrefslogtreecommitdiffstats
path: root/ractor_core.h
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2020-11-26 04:25:42 +0900
committerKoichi Sasada <ko1@atdot.net>2020-11-27 17:03:30 +0900
commit2db2fb9f6c742d5bd0019ccd11c7a375e1b12c0b (patch)
treee5f464004a386e2838a700ad5cced540e8f9953c /ractor_core.h
parent8ce1711c255679d38b6a2405ff694eb5b5b2eae5 (diff)
downloadruby-2db2fb9f6c742d5bd0019ccd11c7a375e1b12c0b.tar.gz
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]
Diffstat (limited to 'ractor_core.h')
-rw-r--r--ractor_core.h2
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;