summaryrefslogtreecommitdiff
path: root/vm_core.h
diff options
context:
space:
mode:
authorSamuel Williams <samuel.williams@oriontransfer.co.nz>2023-03-14 20:07:59 +1300
committerGitHub <noreply@github.com>2023-03-14 20:07:59 +1300
commitac65ce16e904695ba45888d3fba641d12caf733a (patch)
tree35b467c0c77a0eef7aea7a3ffda0dba4fd025408 /vm_core.h
parentb27793835b858b442a7c2c39b442ab688504d3fc (diff)
downloadruby-ac65ce16e904695ba45888d3fba641d12caf733a.tar.gz
Revert SIGCHLD changes to diagnose CI failures. (#7517)
* Revert "Remove special handling of `SIGCHLD`. (#7482)" This reverts commit 44a0711eab7fbc71ac2c8ff489d8c53e97a8fe75. * Revert "Remove prototypes for functions that are no longer used. (#7497)" This reverts commit 4dce12bead3bfd91fd80b5e7195f7f540ffffacb. * Revert "Remove SIGCHLD `waidpid`. (#7476)" This reverts commit 1658e7d96696a656d9bd0a0c84c82cde86914ba2. * Fix change to rjit variable name.
Diffstat (limited to 'vm_core.h')
-rw-r--r--vm_core.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/vm_core.h b/vm_core.h
index c6af487075..ee995b5ff9 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -145,6 +145,9 @@ extern int ruby_assert_critical_section_entered;
# define SIGCHLD_LOSSY (0)
#endif
+/* define to 0 to test old code path */
+#define WAITPID_USE_SIGCHLD (RUBY_SIGCHLD || SIGCHLD_LOSSY)
+
#if defined(SIGSEGV) && defined(HAVE_SIGALTSTACK) && defined(SA_SIGINFO) && !defined(__NetBSD__)
# define USE_SIGALTSTACK
void *rb_allocate_sigaltstack(void);
@@ -649,6 +652,9 @@ typedef struct rb_vm_struct {
#endif
rb_serial_t fork_gen;
+ rb_nativethread_lock_t waitpid_lock;
+ struct ccan_list_head waiting_pids; /* PID > 0: <=> struct waitpid_state */
+ struct ccan_list_head waiting_grps; /* PID <= 0: <=> struct waitpid_state */
struct ccan_list_head waiting_fds; /* <=> struct waiting_fd */
/* set in single-threaded processes only: */
@@ -1756,7 +1762,9 @@ static inline void
rb_vm_living_threads_init(rb_vm_t *vm)
{
ccan_list_head_init(&vm->waiting_fds);
+ ccan_list_head_init(&vm->waiting_pids);
ccan_list_head_init(&vm->workqueue);
+ ccan_list_head_init(&vm->waiting_grps);
ccan_list_head_init(&vm->ractor.set);
}