diff options
author | Fredrik Gustafsson <[email protected]> | 2013-04-15 11:57:40 +0200 |
---|---|---|
committer | Fredrik Gustafsson <[email protected]> | 2013-04-15 11:57:40 +0200 |
commit | 8e236f7c5a0c6383e5f604a781e68b1685127e15 (patch) | |
tree | faf91cbdaa25d71b01e5bfddcfda7bb1d675e7c5 /lib/debugger/src/dbg_debugged.erl | |
parent | f7641c8aafecc7b54b3f6f226892f825ac19f63a (diff) | |
parent | c82e9fad33302ff24fdddbd50f110c06d4eb81d4 (diff) | |
download | otp-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/debugger/src/dbg_debugged.erl')
-rw-r--r-- | lib/debugger/src/dbg_debugged.erl | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/lib/debugger/src/dbg_debugged.erl b/lib/debugger/src/dbg_debugged.erl index c21ad486e8..d8285d7288 100644 --- a/lib/debugger/src/dbg_debugged.erl +++ b/lib/debugger/src/dbg_debugged.erl @@ -19,8 +19,6 @@ -module(dbg_debugged). %% External exports -%% Avoid warning for local function demonitor/1 clashing with autoimported BIF. --compile({no_auto_import,[demonitor/1]}). -export([eval/3]). %%==================================================================== @@ -47,7 +45,7 @@ msg_loop(Meta, Mref, SaveStacktrace) -> %% Evaluated function has returned a value {sys, Meta, {ready, Val}} -> - demonitor(Mref), + erlang:demonitor(Mref, [flush]), %% Restore original stacktrace and return the value try erlang:raise(throw, stack, SaveStacktrace) @@ -63,7 +61,7 @@ msg_loop(Meta, Mref, SaveStacktrace) -> %% Evaluated function raised an (uncaught) exception {sys, Meta, {exception,{Class,Reason,Stacktrace}}} -> - demonitor(Mref), + erlang:demonitor(Mref, [flush]), %% ...raise the same exception erlang:error(erlang:raise(Class, Reason, Stacktrace), @@ -107,14 +105,6 @@ reply({eval,Expr,Bs}) -> %% Bindings is an orddict (sort them) erl_eval:expr(Expr, lists:sort(Bs)). % {value, Value, Bs2} -%% Demonitor and delete message from inbox -%% -demonitor(Mref) -> - erlang:demonitor(Mref), - receive {'DOWN',Mref,_,_,_} -> ok - after 0 -> ok - end. - %% Fix stacktrace - keep all above call to this module. %% stacktrace_f([]) -> []; |