aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/bif.h
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2013-02-08 14:39:31 +0100
committerRickard Green <[email protected]>2013-02-13 12:23:30 +0100
commit953a4bd91e471126370bf5a70956ad233fda189a (patch)
treea51a87e005d63821330efdd8db5374f63fe886d2 /erts/emulator/beam/bif.h
parent56b2a90c7c0e1d9c1e964ee324413d651a37e6e3 (diff)
downloadotp-953a4bd91e471126370bf5a70956ad233fda189a.tar.gz
otp-953a4bd91e471126370bf5a70956ad233fda189a.tar.bz2
otp-953a4bd91e471126370bf5a70956ad233fda189a.zip
Implement erl_drv_consume_timeslice()
Diffstat (limited to 'erts/emulator/beam/bif.h')
-rw-r--r--erts/emulator/beam/bif.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/erts/emulator/beam/bif.h b/erts/emulator/beam/bif.h
index ceaf747875..51b77a95ed 100644
--- a/erts/emulator/beam/bif.h
+++ b/erts/emulator/beam/bif.h
@@ -35,6 +35,13 @@ extern Export* erts_format_cpu_topology_trap;
#define BIF_ARG_2 (BIF__ARGS[1])
#define BIF_ARG_3 (BIF__ARGS[2])
+#define ERTS_IS_PROC_OUT_OF_REDS(p) \
+ ((p)->fcalls > 0 \
+ ? 0 \
+ : (!ERTS_PROC_GET_SAVED_CALLS_BUF((p)) \
+ ? (p)->fcalls == 0 \
+ : ((p)->fcalls == -CONTEXT_REDS)))
+
#define BUMP_ALL_REDS(p) do { \
if (!ERTS_PROC_GET_SAVED_CALLS_BUF((p))) \
(p)->fcalls = 0; \