diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-30 01:34:48 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-10-30 01:34:48 +0000 |
commit | f7c0cc36920a4ed14a3ab1ca6cfdf18ceff1e5d5 (patch) | |
tree | b177b1185abd1ceaf901d82694a2f1757a59da57 /internal.h | |
parent | fbee3b8f75a881072fadb215dd1133e9a5cee30f (diff) |
process.c: implement rb_f_system without toggling ruby_nocldwait
Following how mjit_worker.c currently works, rb_f_system
now ensures the VM-wide waitpid lists is locked before
creating a new process via fork/vfork.
This ensures other rb_waitpid callers cannot steal work and
there are no possible race conditions from toggling
ruby_nocldwait without the use of atomics.
This sets us up for implementing MJIT process management
logic using normal Ruby APIs prepares us for VM-wide
asynchronous/event-base waitpid which can allow MJIT to
work without worker threads.
Take 2: set waitpid_state.pid on platforms w/o fork.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'internal.h')
-rw-r--r-- | internal.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/internal.h b/internal.h index 3f6f5e4608..697a1196fa 100644 --- a/internal.h +++ b/internal.h @@ -1671,6 +1671,7 @@ VALUE rb_block_to_s(VALUE self, const struct rb_block *block, const char *additi /* process.c */ #define RB_MAX_GROUPS (65536) +struct waitpid_state; struct rb_execarg { union { struct { @@ -1700,7 +1701,7 @@ struct rb_execarg { unsigned uid_given : 1; unsigned gid_given : 1; unsigned exception : 1; - unsigned nocldwait_prev : 1; + struct waitpid_state *waitpid_state; /* for async process management */ rb_pid_t pgroup_pgid; /* asis(-1), new pgroup(0), specified pgroup (0<V). */ VALUE rlimit_limits; /* Qfalse or [[rtype, softlim, hardlim], ...] */ mode_t umask_mask; |