diff options
author | Nobuyoshi Nakada <[email protected]> | 2021-03-07 00:58:28 +0900 |
---|---|---|
committer | GitHub <[email protected]> | 2021-03-07 00:58:28 +0900 |
commit | b3c53a8a885be8f5cc2b712798b0d2741c488ce4 (patch) | |
tree | 4d0b0fad023a3867e1b8da884779cca6b57ed5b1 /thread.c | |
parent | 8ccc12118ea5257f846476088eb9c64944560892 (diff) |
Make Ractor stdio belonging to the Ractor [Bug #17672]
Defer making ractor stdio until ractor started.
Before ractor started, created objects belong to the caller ractor
instead of the created ractor.
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/4241
Merged-By: nobu <[email protected]>
Diffstat (limited to 'thread.c')
-rw-r--r-- | thread.c | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -777,6 +777,11 @@ thread_do_start(rb_thread_t *th) void rb_ec_clear_current_thread_trace_func(const rb_execution_context_t *ec); +// io.c +VALUE rb_io_prep_stdin(void); +VALUE rb_io_prep_stdout(void); +VALUE rb_io_prep_stderr(void); + static int thread_start_func_2(rb_thread_t *th, VALUE *stack_start) { @@ -799,6 +804,10 @@ thread_start_func_2(rb_thread_t *th, VALUE *stack_start) RB_VM_LOCK(); { rb_vm_ractor_blocking_cnt_dec(th->vm, th->ractor, __FILE__, __LINE__); + rb_ractor_t *r = th->ractor; + r->r_stdin = rb_io_prep_stdin(); + r->r_stdout = rb_io_prep_stdout(); + r->r_stderr = rb_io_prep_stderr(); } RB_VM_UNLOCK(); } |