aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator
diff options
context:
space:
mode:
authorSverker Eriksson <[email protected]>2018-06-04 14:49:22 +0200
committerSverker Eriksson <[email protected]>2018-06-05 16:00:00 +0200
commit1f5e17c5ce10982c45a7071b0c6b52f419b99402 (patch)
tree27ef6dc652e9b938d66ae0eeef4641d7d65a7da5 /erts/emulator
parent30598c518f793bb7c3893d3996966dca5b858192 (diff)
downloadotp-1f5e17c5ce10982c45a7071b0c6b52f419b99402.tar.gz
otp-1f5e17c5ce10982c45a7071b0c6b52f419b99402.tar.bz2
otp-1f5e17c5ce10982c45a7071b0c6b52f419b99402.zip
erts: Cleanup in proc_queue_signal
* Remove 'last' arg to sig_enqueue_trace_cleanup * Only notify 'rp' if enqueue succeeded
Diffstat (limited to 'erts/emulator')
-rw-r--r--erts/emulator/beam/erl_proc_sig_queue.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/erts/emulator/beam/erl_proc_sig_queue.c b/erts/emulator/beam/erl_proc_sig_queue.c
index dc09efa7d7..1aa390d94d 100644
--- a/erts/emulator/beam/erl_proc_sig_queue.c
+++ b/erts/emulator/beam/erl_proc_sig_queue.c
@@ -423,13 +423,13 @@ sig_enqueue_trace(Process *c_p, ErtsMessage **sigp, int op,
}
static void
-sig_enqueue_trace_cleanup(ErtsMessage *first, ErtsSignal *sig, ErtsMessage *last)
+sig_enqueue_trace_cleanup(ErtsMessage *first, ErtsSignal *sig)
{
ErtsMessage *tmp;
/* The usual case; no tracing signals... */
- if (sig == (ErtsSignal *) first && sig == (ErtsSignal *) last) {
- sig->common.next = NULL;
+ if (sig == (ErtsSignal *) first) {
+ ASSERT(sig->common.next == NULL);
return;
}
@@ -669,7 +669,7 @@ proc_queue_signal(Process *c_p, Eterm pid, ErtsSignal *sig, int op)
first_last_done:
sig->common.specific.next = NULL;
- /* may add signals before and/or after sig */
+ /* may add signals before sig */
sig_enqueue_trace(c_p, sigp, op, rp, &last_next);
last->next = NULL;
@@ -690,18 +690,18 @@ first_last_done:
erts_proc_unlock(rp, ERTS_PROC_LOCK_MSGQ);
if (res == 0) {
- sig_enqueue_trace_cleanup(first, sig, last);
+ sig_enqueue_trace_cleanup(first, sig);
if (pend_sig) {
+ erts_proc_sig_send_monitor_down((ErtsMonitor*)pend_sig, am_noproc);
if (sig == pend_sig) {
/* We did a switch, callers signal is now pending (still ok) */
ASSERT(esdp->pending_signal.sig);
res = 1;
}
- erts_proc_sig_send_monitor_down((ErtsMonitor*)pend_sig, am_noproc);
}
}
-
- erts_proc_notify_new_sig(rp, state, 0);
+ else
+ erts_proc_notify_new_sig(rp, state, 0);
if (!is_normal_sched)
erts_proc_dec_refc(rp);