mirror of
https://github.com/ruby/ruby.git
synced 2025-08-27 15:06:10 +02:00
Some global variables can be accessed from ractors
Some global variables should be used from non-main Ractors. [Bug #17268] ```ruby # ractor-local (derived from created ractor): debug '$DEBUG' => $DEBUG, '$-d' => $-d, # ractor-local (derived from created ractor): verbose '$VERBOSE' => $VERBOSE, '$-w' => $-w, '$-W' => $-W, '$-v' => $-v, # process-local (readonly): other commandline parameters '$-p' => $-p, '$-l' => $-l, '$-a' => $-a, # process-local (readonly): getpid '$$' => $$, # thread local: process result '$?' => $?, # scope local: match '$~' => $~.inspect, '$&' => $&, '$`' => $`, '$\'' => $', '$+' => $+, '$1' => $1, # scope local: last line '$_' => $_, # scope local: last backtrace '$@' => $@, '$!' => $!, # ractor local: stdin, out, err '$stdin' => $stdin.inspect, '$stdout' => $stdout.inspect, '$stderr' => $stderr.inspect, ```
This commit is contained in:
parent
9ced5fae6d
commit
99310e3eb5
Notes:
git
2020-10-20 15:39:18 +09:00
11 changed files with 131 additions and 24 deletions
2
ractor.h
2
ractor.h
|
@ -125,6 +125,8 @@ struct rb_ractor_struct {
|
|||
VALUE r_stdin;
|
||||
VALUE r_stdout;
|
||||
VALUE r_stderr;
|
||||
VALUE verbose;
|
||||
VALUE debug;
|
||||
}; // rb_ractor_t is defined in vm_core.h
|
||||
|
||||
rb_ractor_t *rb_ractor_main_alloc(void);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue