aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_nif.c
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2017-03-24 14:37:45 +0100
committerRickard Green <[email protected]>2017-03-24 14:44:07 +0100
commit1bd867a8dbd88ffcee38b2179d42b563e5078820 (patch)
tree031414b02e1184e3b9278a9ee3f16d2c6e6f9a5a /erts/emulator/beam/erl_nif.c
parent748c2d938d309940b8365ed4f6af863b8129c5bf (diff)
downloadotp-1bd867a8dbd88ffcee38b2179d42b563e5078820.tar.gz
otp-1bd867a8dbd88ffcee38b2179d42b563e5078820.tar.bz2
otp-1bd867a8dbd88ffcee38b2179d42b563e5078820.zip
Fix dirty scheduler type tests
Old test for dirty schedulers didn't work with Visual C++
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 e6da4c1a76..7c7d265257 100644
--- a/erts/emulator/beam/erl_nif.c
+++ b/erts/emulator/beam/erl_nif.c
@@ -2820,14 +2820,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 */