aboutsummaryrefslogtreecommitdiffstats
path: root/lib/runtime_tools/src/dbg.erl
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2013-04-15 11:57:40 +0200
committerFredrik Gustafsson <[email protected]>2013-04-15 11:57:40 +0200
commit8e236f7c5a0c6383e5f604a781e68b1685127e15 (patch)
treefaf91cbdaa25d71b01e5bfddcfda7bb1d675e7c5 /lib/runtime_tools/src/dbg.erl
parentf7641c8aafecc7b54b3f6f226892f825ac19f63a (diff)
parentc82e9fad33302ff24fdddbd50f110c06d4eb81d4 (diff)
downloadotp-8e236f7c5a0c6383e5f604a781e68b1685127e15.tar.gz
otp-8e236f7c5a0c6383e5f604a781e68b1685127e15.tar.bz2
otp-8e236f7c5a0c6383e5f604a781e68b1685127e15.zip
Merge branch 'lh/demonitor-flush/OTP-11039' into maint
* lh/demonitor-flush/OTP-11039: Use erlang:demonitor(Ref, [flush]) where applicable
Diffstat (limited to 'lib/runtime_tools/src/dbg.erl')
-rw-r--r--lib/runtime_tools/src/dbg.erl6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/runtime_tools/src/dbg.erl b/lib/runtime_tools/src/dbg.erl
index 6e3bfe31c6..6b2fb0460f 100644
--- a/lib/runtime_tools/src/dbg.erl
+++ b/lib/runtime_tools/src/dbg.erl
@@ -551,8 +551,7 @@ c(M, F, A, Flags) ->
stop_clear(),
{error, Reason};
{Pid, Res} ->
- erlang:demonitor(Mref),
- receive {'DOWN', Mref, _, _, _} -> ok after 0 -> ok end,
+ erlang:demonitor(Mref, [flush]),
%% 'sleep' prevents the tracer (recv_all_traces) from
%% receiving garbage {'EXIT',...} when dbg i stopped.
timer:sleep(1),
@@ -592,8 +591,7 @@ req(R) ->
{'DOWN', Mref, _, _, _} -> % If server died
exit(dbg_server_crash);
{dbg, Reply} ->
- erlang:demonitor(Mref),
- receive {'DOWN', Mref, _, _, _} -> ok after 0 -> ok end,
+ erlang:demonitor(Mref, [flush]),
Reply
end.