diff options
author | Sverker Eriksson <[email protected]> | 2018-03-02 16:56:13 +0100 |
---|---|---|
committer | Sverker Eriksson <[email protected]> | 2018-03-02 19:16:48 +0100 |
commit | 3e580e039a8eb2467c638503bc526116fe829fec (patch) | |
tree | b4cb3f9e9e51c66370bb05733d669851121cadf8 /lib/kernel | |
parent | e8d0a8654ecf85f89a0c0f7aa26da8bc467e9373 (diff) | |
download | otp-3e580e039a8eb2467c638503bc526116fe829fec.tar.gz otp-3e580e039a8eb2467c638503bc526116fe829fec.tar.bz2 otp-3e580e039a8eb2467c638503bc526116fe829fec.zip |
kernel,stdlib: Remove obsolete use of send with 'noconnect'
as workarounds to avoid blocking auto-connect,
which is now asynchronous in OTP-21.
Also changed old catch to more efficient try-catch.
Diffstat (limited to 'lib/kernel')
-rw-r--r-- | lib/kernel/src/net_kernel.erl | 8 | ||||
-rw-r--r-- | lib/kernel/src/rpc.erl | 5 |
2 files changed, 5 insertions, 8 deletions
diff --git a/lib/kernel/src/net_kernel.erl b/lib/kernel/src/net_kernel.erl index cdb10a7b12..f38989d103 100644 --- a/lib/kernel/src/net_kernel.erl +++ b/lib/kernel/src/net_kernel.erl @@ -1777,16 +1777,16 @@ async_reply({reply, Msg, State}, From) -> async_gen_server_reply(From, Msg) -> {Pid, Tag} = From, M = {Tag, Msg}, - case catch erlang:send(Pid, M, [nosuspend, noconnect]) of + try erlang:send(Pid, M, [nosuspend, noconnect]) of ok -> ok; nosuspend -> _ = spawn(fun() -> catch erlang:send(Pid, M, [noconnect]) end), ok; noconnect -> - ok; % The gen module takes care of this case. - {'EXIT', _} -> - ok + ok % The gen module takes care of this case. + catch + _:_ -> ok end. call_owner(Owner, Msg) -> diff --git a/lib/kernel/src/rpc.erl b/lib/kernel/src/rpc.erl index 0e0b7dffa3..917e725fd6 100644 --- a/lib/kernel/src/rpc.erl +++ b/lib/kernel/src/rpc.erl @@ -418,10 +418,7 @@ abcast(Name, Mess) -> abcast([Node|Tail], Name, Mess) -> Dest = {Name,Node}, - case catch erlang:send(Dest, Mess, [noconnect]) of - noconnect -> spawn(erlang, send, [Dest,Mess]), ok; - _ -> ok - end, + try erlang:send(Dest, Mess) catch error:_ -> ok end, abcast(Tail, Name, Mess); abcast([], _,_) -> abcast. |