aboutsummaryrefslogtreecommitdiffstats
path: root/erts/preloaded/src
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2018-04-12 14:07:05 +0200
committerLukas Larsson <[email protected]>2018-04-12 14:07:05 +0200
commitbf1c50e0e6a43c87d375029b732424f686e564f6 (patch)
tree773bbaf3b1d7d1809703d8f81ddf3fb3bf844a71 /erts/preloaded/src
parent7d6a44f848565bba425303faea5cb4e30f286a42 (diff)
parent994a1229418c34846c1e2b5d08e72aa30ac5fa5f (diff)
downloadotp-bf1c50e0e6a43c87d375029b732424f686e564f6.tar.gz
otp-bf1c50e0e6a43c87d375029b732424f686e564f6.tar.bz2
otp-bf1c50e0e6a43c87d375029b732424f686e564f6.zip
Merge branch 'lukas/erts/init_restart_flush_messages/OTP-15013'
* lukas/erts/init_restart_flush_messages/OTP-15013: erts: Flush messages before doing init restart
Diffstat (limited to 'erts/preloaded/src')
-rw-r--r--erts/preloaded/src/init.erl9
1 files changed, 9 insertions, 0 deletions
diff --git a/erts/preloaded/src/init.erl b/erts/preloaded/src/init.erl
index e0ae6b1656..0c74169e97 100644
--- a/erts/preloaded/src/init.erl
+++ b/erts/preloaded/src/init.erl
@@ -545,6 +545,8 @@ stop(Reason,State) ->
do_stop(Reason,State1).
do_stop(restart,#state{start = Start, flags = Flags, args = Args}) ->
+ %% Make sure we don't have any outstanding messages before doing the restart.
+ flush(),
boot(Start,Flags,Args);
do_stop(reboot,_) ->
halt();
@@ -560,6 +562,13 @@ clear_system(BootPid,State) ->
shutdown_pids(Heart,BootPid,State),
unload(Heart).
+flush() ->
+ receive
+ _M -> flush()
+ after 0 ->
+ ok
+ end.
+
stop_heart(State) ->
case get_heart(State#state.kernel) of
false ->