diff options
author | Fredrik Gustafsson <[email protected]> | 2013-04-15 11:57:59 +0200 |
---|---|---|
committer | Fredrik Gustafsson <[email protected]> | 2013-04-15 11:57:59 +0200 |
commit | efbf57358b8afca275545a627713bcf14969e243 (patch) | |
tree | 6fc8087ac679d2d545b63b1f2de9fb303e65f3e1 /lib/kernel/src/rpc.erl | |
parent | 057c411456f6e60cd1fcf0acd1a226381f43cea8 (diff) | |
parent | 8e236f7c5a0c6383e5f604a781e68b1685127e15 (diff) | |
download | otp-efbf57358b8afca275545a627713bcf14969e243.tar.gz otp-efbf57358b8afca275545a627713bcf14969e243.tar.bz2 otp-efbf57358b8afca275545a627713bcf14969e243.zip |
Merge branch 'maint'
Diffstat (limited to 'lib/kernel/src/rpc.erl')
-rw-r--r-- | lib/kernel/src/rpc.erl | 24 |
1 files changed, 4 insertions, 20 deletions
diff --git a/lib/kernel/src/rpc.erl b/lib/kernel/src/rpc.erl index 7c965ca384..83e0b59cc2 100644 --- a/lib/kernel/src/rpc.erl +++ b/lib/kernel/src/rpc.erl @@ -388,13 +388,8 @@ server_call(Node, Name, ReplyWrapper, Msg) {'DOWN', Ref, _, _, _} -> {error, nodedown}; {ReplyWrapper, Node, Reply} -> - erlang:demonitor(Ref), - receive - {'DOWN', Ref, _, _, _} -> - Reply - after 0 -> - Reply - end + erlang:demonitor(Ref, [flush]), + Reply end end. @@ -501,17 +496,6 @@ start_monitor(Node, Name) -> {Node,erlang:monitor(process, {Name, Node})} end. -%% Cancels a monitor started with Ref=erlang:monitor(_, _), -%% i.e return value {Node, Ref} from start_monitor/2 above. -unmonitor(Ref) when is_reference(Ref) -> - erlang:demonitor(Ref), - receive - {'DOWN', Ref, _, _, _} -> - true - after 0 -> - true - end. - %% Call apply(M,F,A) on all nodes in parallel -spec multicall(Module, Function, Args) -> {ResL, BadNodes} when @@ -635,10 +619,10 @@ rec_nodes(Name, [{N,R} | Tail], Badnodes, Replies) -> rec_nodes(Name, Tail, [N|Badnodes], Replies); {?NAME, N, {nonexisting_name, _}} -> %% used by sbcast() - unmonitor(R), + erlang:demonitor(R, [flush]), rec_nodes(Name, Tail, [N|Badnodes], Replies); {Name, N, Reply} -> %% Name is bound !!! - unmonitor(R), + erlang:demonitor(R, [flush]), rec_nodes(Name, Tail, Badnodes, [Reply|Replies]) end. |