From: Eric Wong <e@80x24.org>
To: spew@80x24.org
Cc: Eric Wong <e@80x24.org>
Subject: [PATCH 4/8] cleanups
Date: Mon, 25 Jun 2018 23:50:47 +0000 [thread overview]
Message-ID: <20180625235051.66045-5-e@80x24.org> (raw)
In-Reply-To: <20180625235051.66045-1-e@80x24.org>
---
mjit.c | 9 ++-------
signal.c | 12 ------------
vm_core.h | 8 ++++++++
3 files changed, 10 insertions(+), 19 deletions(-)
diff --git a/mjit.c b/mjit.c
index 659461cea6..a550d1aabd 100644
--- a/mjit.c
+++ b/mjit.c
@@ -119,7 +119,7 @@ extern void rb_native_cond_wait(rb_nativethread_cond_t *cond, rb_nativethread_lo
extern int rb_thread_create_mjit_thread(void (*child_hook)(void), void (*worker_func)(void));
-
+/* process.c */
pid_t ruby_waitpid_locked(rb_vm_t *, rb_pid_t, int *status, int options,
rb_nativethread_cond_t *cond);
@@ -137,7 +137,6 @@ pid_t ruby_waitpid_locked(rb_vm_t *, rb_pid_t, int *status, int options,
#define WEXITSTATUS(S) (S)
#define WIFSIGNALED(S) (0)
typedef intptr_t pid_t;
-#define USE_RUBY_WAITPID_LOCKED (0)
#endif
/* Atomically set function pointer if possible. */
@@ -151,10 +150,6 @@ typedef intptr_t pid_t;
# define MJIT_ATOMIC_SET(var, val) ATOMIC_SET(var, val)
#endif
-#ifndef USE_RUBY_WAITPID_LOCKED /* platforms with real waitpid */
-# define USE_RUBY_WAITPID_LOCKED (1)
-#endif /* USE_RUBY_WAITPID_LOCKED */
-
/* A copy of MJIT portion of MRI options since MJIT initialization. We
need them as MJIT threads still can work when the most MRI data were
freed. */
@@ -413,7 +408,7 @@ exec_process(const char *path, char *const argv[])
{
int stat, exit_code = -2;
pid_t pid;
- rb_vm_t *vm = USE_RUBY_WAITPID_LOCKED ? GET_VM() : 0;
+ rb_vm_t *vm = RUBY_SIGCHLD ? GET_VM() : 0;
rb_nativethread_cond_t cond;
if (vm) {
diff --git a/signal.c b/signal.c
index 22fc4286d9..b816403cb9 100644
--- a/signal.c
+++ b/signal.c
@@ -62,18 +62,6 @@ ruby_atomic_compare_and_swap(rb_atomic_t *ptr, rb_atomic_t cmp,
}
#endif
-#ifndef NSIG
-# define NSIG (_SIGMAX + 1) /* For QNX */
-#endif
-
-#if defined(SIGCLD)
-# define RUBY_SIGCHLD (SIGCLD)
-#elif defined(SIGCHLD)
-# define RUBY_SIGCHLD (SIGCHLD)
-#else
-# define RUBY_SIGCHLD (0)
-#endif
-
static const struct signals {
const char *signm;
int signo;
diff --git a/vm_core.h b/vm_core.h
index d0689e5ba6..936b22d439 100644
--- a/vm_core.h
+++ b/vm_core.h
@@ -92,6 +92,14 @@
#define RUBY_NSIG NSIG
+#if defined(SIGCLD)
+# define RUBY_SIGCHLD (SIGCLD)
+#elif defined(SIGCHLD)
+# define RUBY_SIGCHLD (SIGCHLD)
+#else
+# define RUBY_SIGCHLD (0)
+#endif
+
#ifdef HAVE_STDARG_PROTOTYPES
#include <stdarg.h>
#define va_init_list(a,b) va_start((a),(b))
--
EW
next prev parent reply other threads:[~2018-06-25 23:50 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-25 23:50 [PATCHv3 0/8] mjit SIGCHLD hijack series Eric Wong
2018-06-25 23:50 ` [PATCH 1/8] hijack SIGCHLD handler for internal use Eric Wong
2018-06-25 23:50 ` [PATCH 2/8] fix SIGCHLD hijacking race conditions Eric Wong
2018-06-25 23:50 ` [PATCH 3/8] mjit.c: allow working on platforms without SIGCHLD Eric Wong
2018-06-25 23:50 ` Eric Wong [this message]
2018-06-25 23:50 ` [PATCH 5/8] handle SIGCHLD in both the timer-thread and main thread Eric Wong
2018-06-25 23:50 ` [PATCH 6/8] Revert "test_process.rb: skip tests for Bug 14867" Eric Wong
2018-06-25 23:50 ` [PATCH 7/8] Revert "spec: skip Process wait specs on MJIT" Eric Wong
2018-06-25 23:50 ` [PATCH 8/8] wip testing Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180625235051.66045-5-e@80x24.org \
--to=e@80x24.org \
--cc=spew@80x24.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).