aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/bif.c
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2012-08-02 17:36:06 +0200
committerRickard Green <[email protected]>2012-08-02 17:36:06 +0200
commitff1a1e3c6f9a233b880e9d359a1c50e55d7c812f (patch)
tree2a3fb137788674f6a3e27dae62aa367f85f6160e /erts/emulator/beam/bif.c
parent10c218e71f30754be31d8091a9e98f3946ec991d (diff)
downloadotp-ff1a1e3c6f9a233b880e9d359a1c50e55d7c812f.tar.gz
otp-ff1a1e3c6f9a233b880e9d359a1c50e55d7c812f.tar.bz2
otp-ff1a1e3c6f9a233b880e9d359a1c50e55d7c812f.zip
Read message queue lengths while having lock
Diffstat (limited to 'erts/emulator/beam/bif.c')
-rw-r--r--erts/emulator/beam/bif.c15
1 files changed, 4 insertions, 11 deletions
diff --git a/erts/emulator/beam/bif.c b/erts/emulator/beam/bif.c
index 160b1ef0fc..20ac0637e5 100644
--- a/erts/emulator/beam/bif.c
+++ b/erts/emulator/beam/bif.c
@@ -2051,18 +2051,11 @@ do_send(Process *p, Eterm to, Eterm msg, int suspend) {
rp_locks |= ERTS_PROC_LOCK_MAIN;
#endif
/* send to local process */
- erts_send_message(p, rp, &rp_locks, msg, 0);
- if (!erts_use_sender_punish)
+ res = erts_send_message(p, rp, &rp_locks, msg, 0);
+ if (erts_use_sender_punish)
+ res *= 4;
+ else
res = 0;
- else {
-#ifdef ERTS_SMP
- res = rp->msg_inq.len*4;
- if (ERTS_PROC_LOCK_MAIN & rp_locks)
- res += rp->msg.len*4;
-#else
- res = rp->msg.len*4;
-#endif
- }
erts_smp_proc_unlock(rp,
p == rp
? (rp_locks & ~ERTS_PROC_LOCK_MAIN)