aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2013-04-01 18:49:52 +0200
committerLoïc Hoguin <[email protected]>2013-04-01 20:41:20 +0200
commit3bdde42c1f945a1485b36b3fe33839f93199339e (patch)
treea9d1077695263f9d9345f487cc1c0ce37eb22ce4
parenta86bb2d592486144414fbbebca85ab36ffca2446 (diff)
downloadotp-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.erl6
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