summaryrefslogtreecommitdiff
path: root/mjit_worker.c
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-11 08:07:13 (GMT)
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-08-11 08:07:13 (GMT)
commitb2e0d54024766009567baa708ae3bed1f50dd5ed (patch)
tree2fa84d0ffe45ac5131c474c3fbc42d7fb365d6a9 /mjit_worker.c
parent58de76846bb873a29bd38cc64f36577d2de6b311 (diff)
mjit_worker.c: prefix mjit_ to pch_status
which was just forgotten. mjit.c: ditto mjit_internal.h: moved some macros only used by mjit_worker.c to it. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'mjit_worker.c')
-rw-r--r--mjit_worker.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/mjit_worker.c b/mjit_worker.c
index 57c3016..5b0d28d 100644
--- a/mjit_worker.c
+++ b/mjit_worker.c
@@ -101,6 +101,14 @@
#include "dln.h"
#include "mjit_internal.h"
+#ifdef _WIN32
+#define waitpid(pid,stat_loc,options) (WaitForSingleObject((HANDLE)(pid), INFINITE), GetExitCodeProcess((HANDLE)(pid), (LPDWORD)(stat_loc)), (pid))
+#define WIFEXITED(S) ((S) != STILL_ACTIVE)
+#define WEXITSTATUS(S) (S)
+#define WIFSIGNALED(S) (0)
+typedef intptr_t pid_t;
+#endif
+
/* process.c */
rb_pid_t ruby_waitpid_locked(rb_vm_t *, rb_pid_t, int *status, int options,
rb_nativethread_cond_t *cond);
@@ -198,7 +206,7 @@ static const char *const CC_LIBS[] = {
/* Status of the precompiled header creation. The status is
shared by the workers and the pch thread. */
-enum pch_status_t pch_status;
+enum pch_status_t mjit_pch_status;
/* Return the best unit from list. The best is the first
high priority unit or the unit whose iseq has the biggest number
@@ -461,7 +469,7 @@ make_pch(void)
if (mjit_opts.warnings || mjit_opts.verbose)
fprintf(stderr, "MJIT warning: making precompiled header failed on forming args\n");
CRITICAL_SECTION_START(3, "in make_pch");
- pch_status = PCH_FAILED;
+ mjit_pch_status = PCH_FAILED;
CRITICAL_SECTION_FINISH(3, "in make_pch");
return;
}
@@ -471,11 +479,11 @@ make_pch(void)
CRITICAL_SECTION_START(3, "in make_pch");
if (exit_code == 0) {
- pch_status = PCH_SUCCESS;
+ mjit_pch_status = PCH_SUCCESS;
} else {
if (mjit_opts.warnings || mjit_opts.verbose)
fprintf(stderr, "MJIT warning: Making precompiled header failed on compilation. Stopping MJIT worker...\n");
- pch_status = PCH_FAILED;
+ mjit_pch_status = PCH_FAILED;
}
/* wakeup `mjit_finish` */
rb_native_cond_broadcast(&mjit_pch_wakeup);
@@ -843,11 +851,11 @@ void
mjit_worker(void)
{
#ifndef _MSC_VER
- if (pch_status == PCH_NOT_READY) {
+ if (mjit_pch_status == PCH_NOT_READY) {
make_pch();
}
#endif
- if (pch_status == PCH_FAILED) {
+ if (mjit_pch_status == PCH_FAILED) {
mjit_enabled = FALSE;
CRITICAL_SECTION_START(3, "in worker to update mjit_worker_stopped");
mjit_worker_stopped = TRUE;