diff options
author | Samuel Williams <samuel.williams@oriontransfer.co.nz> | 2023-03-15 19:48:27 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-15 19:48:27 +1300 |
commit | 7fd53eeb46db261bbc20025cdab70096245a5cbe (patch) | |
tree | 49d8705a22f3c8e872469a950991bf1cbe65bfae /signal.c | |
parent | ce47ee00ae295b31dc023afb935a60ecc39a1f4b (diff) |
Remove SIGCHLD `waidpid`. (#7527)
* Remove `waitpid_lock` and related code. * Remove un-necessary test. * Remove `rb_thread_sleep_interruptible` dead code.
Notes
Notes: Merged-By: ioquatix <samuel@codeotaku.com>
Diffstat (limited to 'signal.c')
-rw-r--r-- | signal.c | 40 |
1 files changed, 1 insertions, 39 deletions
@@ -1085,16 +1085,6 @@ rb_vm_trap_exit(rb_vm_t *vm) } } -void ruby_waitpid_all(rb_vm_t *); /* process.c */ - -void -ruby_sigchld_handler(rb_vm_t *vm) -{ - if (SIGCHLD_LOSSY || GET_SIGCHLD_HIT()) { - ruby_waitpid_all(vm); - } -} - /* returns true if a trap handler was run, false otherwise */ int rb_signal_exec(rb_thread_t *th, int sig) @@ -1623,33 +1613,5 @@ fake_grantfd(int masterfd) int rb_grantpt(int masterfd) { - if (RUBY_SIGCHLD) { - rb_vm_t *vm = GET_VM(); - int ret, e; - - /* - * Prevent waitpid calls from Ruby by taking waitpid_lock. - * Pedantically, grantpt(3) is undefined if a non-default - * SIGCHLD handler is defined, but preventing conflicting - * waitpid calls ought to be sufficient. - * - * We could install the default sighandler temporarily, but that - * could cause SIGCHLD to be missed by other threads. Blocking - * SIGCHLD won't work here, either, unless we stop and restart - * timer-thread (as only timer-thread sees SIGCHLD), but that - * seems like overkill. - */ - rb_nativethread_lock_lock(&vm->waitpid_lock); - { - ret = grantpt(masterfd); /* may spawn `pt_chown' and wait on it */ - if (ret < 0) e = errno; - } - rb_nativethread_lock_unlock(&vm->waitpid_lock); - - if (ret < 0) errno = e; - return ret; - } - else { - return grantpt(masterfd); - } + return grantpt(masterfd); } |