aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_process.h
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2016-08-30 15:53:45 +0200
committerRickard Green <[email protected]>2016-08-30 15:53:45 +0200
commit037bde5b479c18711a32713751f9ae79b29a8741 (patch)
tree23fc7a0e3fadf74333a1db1128367194f6e15488 /erts/emulator/beam/erl_process.h
parent16f4bd5f6cb5fe6d6412ae219634902813bd9cce (diff)
parent2c8a13e5d3aabeedeb290624d6acc02d25db1bd5 (diff)
downloadotp-037bde5b479c18711a32713751f9ae79b29a8741.tar.gz
otp-037bde5b479c18711a32713751f9ae79b29a8741.tar.bz2
otp-037bde5b479c18711a32713751f9ae79b29a8741.zip
Merge branch 'rickard/ds-win-32bit/OTP-13759' into maint
* rickard/ds-win-32bit/OTP-13759: Fix dirty schedulers build on windows
Diffstat (limited to 'erts/emulator/beam/erl_process.h')
-rw-r--r--erts/emulator/beam/erl_process.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/erts/emulator/beam/erl_process.h b/erts/emulator/beam/erl_process.h
index f1788c3f71..94c13bb948 100644
--- a/erts/emulator/beam/erl_process.h
+++ b/erts/emulator/beam/erl_process.h
@@ -2473,6 +2473,35 @@ erts_get_atom_cache_map(Process *c_p)
}
#endif
+#ifdef __WIN32__
+/*
+ * Don't want erts_time2reds() inlined in beam_emu.c on windows since
+ * it is compiled with gcc which fails on it. Implementation is in
+ * erl_process.c on windows.
+ */
+# define ERTS_TIME2REDS_IMPL__ erts_time2reds__
+#else
+# define ERTS_TIME2REDS_IMPL__ erts_time2reds
+#endif
+
+ERTS_GLB_INLINE Sint64 ERTS_TIME2REDS_IMPL__(ErtsMonotonicTime start,
+ ErtsMonotonicTime end);
+
+#if ERTS_GLB_INLINE_INCL_FUNC_DEF
+ERTS_GLB_INLINE Sint64
+ERTS_TIME2REDS_IMPL__(ErtsMonotonicTime start, ErtsMonotonicTime end)
+{
+ ErtsMonotonicTime time = end - start;
+ ASSERT(time >= 0);
+ time = ERTS_MONOTONIC_TO_USEC(time);
+ if (time == 0)
+ return (Sint64) 1; /* At least one reduction */
+ /* Currently two reductions per micro second */
+ time *= (CONTEXT_REDS-1)/1000 + 1;
+ return (Sint64) time;
+}
+#endif
+
Process *erts_pid2proc_suspend(Process *,
ErtsProcLocks,
Eterm,