aboutsummaryrefslogtreecommitdiffstats
path: root/erts/emulator/beam/io.c
diff options
context:
space:
mode:
authorRickard Green <[email protected]>2016-03-18 11:55:48 +0100
committerRickard Green <[email protected]>2016-03-18 16:43:46 +0100
commit455cbcf2230715b37da14573cb9ba60a68c24a26 (patch)
treefd93952641bb57ad2db27132440678e2d3bc2255 /erts/emulator/beam/io.c
parent05f11890bdfec4bfc3a78e191a87e70a937ffc54 (diff)
downloadotp-455cbcf2230715b37da14573cb9ba60a68c24a26.tar.gz
otp-455cbcf2230715b37da14573cb9ba60a68c24a26.tar.bz2
otp-455cbcf2230715b37da14573cb9ba60a68c24a26.zip
Fix implementation of dropped signal to port
Diffstat (limited to 'erts/emulator/beam/io.c')
-rw-r--r--erts/emulator/beam/io.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/erts/emulator/beam/io.c b/erts/emulator/beam/io.c
index 8c67f731f4..9a67e05bfa 100644
--- a/erts/emulator/beam/io.c
+++ b/erts/emulator/beam/io.c
@@ -1501,8 +1501,19 @@ erts_schedule_proc2port_signal(Process *c_p,
erts_smp_proc_lock(c_p, ERTS_PROC_LOCK_MAIN);
if (sched_res != 0) {
- if (refp)
+ if (refp) {
+ /*
+ * We need to restore the message queue save
+ * pointer to the beginning of the message queue
+ * since the caller now wont wait for a message
+ * containing the reference created above...
+ */
+ ASSERT(c_p);
+ erts_smp_proc_lock(c_p, ERTS_PROC_LOCKS_MSG_RECEIVE);
+ JOIN_MESSAGE(c_p);
+ erts_smp_proc_unlock(c_p, ERTS_PROC_LOCKS_MSG_RECEIVE);
*refp = NIL;
+ }
return ERTS_PORT_OP_DROPPED;
}
return ERTS_PORT_OP_SCHEDULED;