diff options
author | Rickard Green <[email protected]> | 2016-03-29 14:52:34 +0200 |
---|---|---|
committer | Rickard Green <[email protected]> | 2016-03-29 14:52:34 +0200 |
commit | c921c91178c6626381ddd64249ec1ce670de2595 (patch) | |
tree | 2b3ea954da1bd709041d110c24b7caefb137ed45 | |
parent | 9be7db7401d3e107f6f63cb02117d1ffa1db1311 (diff) | |
parent | 455cbcf2230715b37da14573cb9ba60a68c24a26 (diff) | |
download | otp-c921c91178c6626381ddd64249ec1ce670de2595.tar.gz otp-c921c91178c6626381ddd64249ec1ce670de2595.tar.bz2 otp-c921c91178c6626381ddd64249ec1ce670de2595.zip |
Merge branch 'rickard/port-sig-dropped-fix/OTP-13424'
* rickard/port-sig-dropped-fix/OTP-13424:
Fix implementation of dropped signal to port
-rw-r--r-- | erts/emulator/beam/io.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/erts/emulator/beam/io.c b/erts/emulator/beam/io.c index 797e4cdadc..324c05c766 100644 --- a/erts/emulator/beam/io.c +++ b/erts/emulator/beam/io.c @@ -1542,8 +1542,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; |