diff options
author | Loïc Hoguin <[email protected]> | 2013-04-01 18:49:52 +0200 |
---|---|---|
committer | Loïc Hoguin <[email protected]> | 2013-04-01 20:41:20 +0200 |
commit | 3bdde42c1f945a1485b36b3fe33839f93199339e (patch) | |
tree | a9d1077695263f9d9345f487cc1c0ce37eb22ce4 | |
parent | a86bb2d592486144414fbbebca85ab36ffca2446 (diff) | |
download | otp-3bdde42c1f945a1485b36b3fe33839f93199339e.tar.gz otp-3bdde42c1f945a1485b36b3fe33839f93199339e.tar.bz2 otp-3bdde42c1f945a1485b36b3fe33839f93199339e.zip |
Use erlang:demonitor's flush option on timeout
It is equivalent to the few lines removed, except more efficient.
-rw-r--r-- | lib/stdlib/src/gen.erl | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/lib/stdlib/src/gen.erl b/lib/stdlib/src/gen.erl index d9db17170b..5df5530ba1 100644 --- a/lib/stdlib/src/gen.erl +++ b/lib/stdlib/src/gen.erl @@ -218,11 +218,7 @@ do_call(Process, Label, Request, Timeout) -> {'DOWN', Mref, _, _, Reason} -> exit(Reason) after Timeout -> - erlang:demonitor(Mref), - receive - {'DOWN', Mref, _, _, _} -> true - after 0 -> true - end, + erlang:demonitor(Mref, [flush]), exit(timeout) end catch |