aboutsummaryrefslogtreecommitdiffstats
path: root/erts
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2019-02-18 20:08:27 +0100
committerSverker Eriksson <[email protected]>2019-02-18 20:08:27 +0100
commit2697f7d469d2cb0944af976b4f4ac7f5db0dc6aa (patch)
treef01359ef81441d1d2410f35741ace3bbf5e382c4 /erts
parent5caddff6454167783460a6533c3145a510349cc5 (diff)
downloadotp-2697f7d469d2cb0944af976b4f4ac7f5db0dc6aa.tar.gz
otp-2697f7d469d2cb0944af976b4f4ac7f5db0dc6aa.tar.bz2
otp-2697f7d469d2cb0944af976b4f4ac7f5db0dc6aa.zip
erts: Make enif_consume_timeslice no-op on dirty sched
Diffstat (limited to 'erts')
-rw-r--r--erts/emulator/beam/erl_nif.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c
index 17041cc91c..ebef485b04 100644
--- a/erts/emulator/beam/erl_nif.c
+++ b/erts/emulator/beam/erl_nif.c
@@ -2701,8 +2701,12 @@ int enif_consume_timeslice(ErlNifEnv* env, int percent)
{
Process *proc;
Sint reds;
+ int sched;
- execution_state(env, &proc, NULL);
+ execution_state(env, &proc, &sched);
+
+ if (sched < 0)
+ return 0; /* no-op on dirty scheduler */
ASSERT(is_proc_bound(env) && percent >= 1 && percent <= 100);
if (percent < 1) percent = 1;