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/stdlib/src/gen_statem.erl | |
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/stdlib/src/gen_statem.erl')
-rw-r--r-- | lib/stdlib/src/gen_statem.erl | 13 |
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/stdlib/src/gen_statem.erl b/lib/stdlib/src/gen_statem.erl index f95b2ea9cd..9dc360a289 100644 --- a/lib/stdlib/src/gen_statem.erl +++ b/lib/stdlib/src/gen_statem.erl @@ -641,16 +641,11 @@ replies([]) -> %% Might actually not send the message in case of caught exception send(Proc, Msg) -> - try erlang:send(Proc, Msg, [noconnect]) of - noconnect -> - _ = spawn(erlang, send, [Proc,Msg]), - ok; - ok -> - ok + try erlang:send(Proc, Msg) catch - _:_ -> - ok - end. + error:_ -> ok + end, + ok. %% Here the init_it/6 and enter_loop/5,6,7 functions converge enter(Module, Opts, State, Data, Server, Actions, Parent) -> |