aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/erl_nif.c
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2018-04-26 19:14:31 +0200
committerSverker Eriksson <[email protected]>2018-04-26 19:14:31 +0200
commit613cde66c25464121f2f6dace99782bad0e07d9b (patch)
treef0300eb3b558342a89a97aacd4f141b56f22dca4 /erts/emulator/beam/erl_nif.c
parentd7e27dd3174f61a6119cfaf505f5ede4b0ab5371 (diff)
downloadotp-613cde66c25464121f2f6dace99782bad0e07d9b.tar.gz
otp-613cde66c25464121f2f6dace99782bad0e07d9b.tar.bz2
otp-613cde66c25464121f2f6dace99782bad0e07d9b.zip
erts: Optimize monitor signal by message piggyback
If no message/signal is sent (to same destination) then monitor signal is flushed when process is scheduled out.
Diffstat (limited to 'erts/emulator/beam/erl_nif.c')
-rw-r--r--erts/emulator/beam/erl_nif.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/erts/emulator/beam/erl_nif.c b/erts/emulator/beam/erl_nif.c
index 260656e2d3..e208792868 100644
--- a/erts/emulator/beam/erl_nif.c
+++ b/erts/emulator/beam/erl_nif.c
@@ -665,7 +665,7 @@ int erts_flush_trace_messages(Process *c_p, ErtsProcLocks c_p_locks)
rp_locks = 0;
if (rp->common.id == c_p->common.id)
rp_locks = c_p_locks;
- erts_queue_messages(rp, rp_locks, first, last, len);
+ erts_queue_proc_messages(c_p, rp, rp_locks, first, last, len);
if (rp->common.id == c_p->common.id)
rp_locks &= ~c_p_locks;
if (rp_locks)
@@ -856,7 +856,10 @@ int enif_send(ErlNifEnv* env, const ErlNifPid* to_pid,
}
}
- erts_queue_message(rp, rp_locks, mp, msg, from);
+ if (c_p)
+ erts_queue_proc_message(c_p, rp, rp_locks, mp, msg);
+ else
+ erts_queue_message(rp, rp_locks, mp, msg, from);
done:
if (c_p == rp)