aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_nif.c
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2017-04-11 17:57:48 +0200
committerRickard Green <[email protected]>2017-04-11 17:57:48 +0200
commitd37bcb84be7c16dcb1c8637c1c3777a6d02932e7 (patch)
tree1f758d4c30202cc5f4ef773e6edd6e022c522b32 /erts/emulator/beam/erl_nif.c
parent92a3b1a37182527d0bf8b6242d54e7fae6f4bbf9 (diff)
parent1bd867a8dbd88ffcee38b2179d42b563e5078820 (diff)
downloadotp-d37bcb84be7c16dcb1c8637c1c3777a6d02932e7.tar.gz
otp-d37bcb84be7c16dcb1c8637c1c3777a6d02932e7.tar.bz2
otp-d37bcb84be7c16dcb1c8637c1c3777a6d02932e7.zip
Merge branch 'rickard/sched_type_tests'
* rickard/sched_type_tests: Fix dirty scheduler type tests
Diffstat (limited to 'erts/emulator/beam/erl_nif.c')
-rw-r--r--erts/emulator/beam/erl_nif.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c
index 63a4a997da..f86b9739fa 100644
--- a/erts/emulator/beam/erl_nif.c
+++ b/erts/emulator/beam/erl_nif.c
@@ -2818,14 +2818,19 @@ enif_thread_type(void)
if (!esdp)
return ERL_NIF_THR_UNDEFINED;
- if (!ERTS_SCHEDULER_IS_DIRTY(esdp))
+ switch (esdp->type) {
+ case ERTS_SCHED_NORMAL:
return ERL_NIF_THR_NORMAL_SCHEDULER;
-
- if (ERTS_SCHEDULER_IS_DIRTY_CPU(esdp))
+#ifdef ERTS_DIRTY_SCHEDULERS
+ case ERTS_SCHED_DIRTY_CPU:
return ERL_NIF_THR_DIRTY_CPU_SCHEDULER;
-
- ASSERT(ERTS_SCHEDULER_IS_DIRTY_IO(esdp));
- return ERL_NIF_THR_DIRTY_IO_SCHEDULER;
+ case ERTS_SCHED_DIRTY_IO:
+ return ERL_NIF_THR_DIRTY_IO_SCHEDULER;
+#endif
+ default:
+ ERTS_INTERNAL_ERROR("Invalid scheduler type");
+ return -1;
+ }
}
/* Maps */