aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/bif.h
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2013-02-14 17:43:21 +0100
committerRickard Green <[email protected]>2013-02-14 17:43:21 +0100
commitb708bf2064513e524eec1d5de1a9e76e97a20131 (patch)
treedeb7304828ad2cde93b120bfc866a39b45100768 /erts/emulator/beam/bif.h
parent85775c504842e669d0bca9c62909366990954ed2 (diff)
parent953a4bd91e471126370bf5a70956ad233fda189a (diff)
downloadotp-b708bf2064513e524eec1d5de1a9e76e97a20131.tar.gz
otp-b708bf2064513e524eec1d5de1a9e76e97a20131.tar.bz2
otp-b708bf2064513e524eec1d5de1a9e76e97a20131.zip
Merge branch 'rickard/erl_drv_consume_timeslice/OTP-10810'
* rickard/erl_drv_consume_timeslice/OTP-10810: 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; \