aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/beam_lib.erl
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2011-10-11 10:38:48 +0200
committerMicael Karlberg <[email protected]>2011-10-11 10:38:48 +0200
commit8490c3a413ca4a89c0a2f37e8723b2105cbe2406 (patch)
tree8dbae16e97b8f5872f7feae2c983ef8e43b0903e /lib/stdlib/src/beam_lib.erl
parentadacb706e77b90a9284c3f4d8c828992c9acebf8 (diff)
parent6ca6dd3c670fb8185ebb9a20c2a731a7375c1cac (diff)
downloadotp-8490c3a413ca4a89c0a2f37e8723b2105cbe2406.tar.gz
otp-8490c3a413ca4a89c0a2f37e8723b2105cbe2406.tar.bz2
otp-8490c3a413ca4a89c0a2f37e8723b2105cbe2406.zip
Merge branch 'master' of super:otp into bmk/inets/inets58_integration
Diffstat (limited to 'lib/stdlib/src/beam_lib.erl')
-rw-r--r--lib/stdlib/src/beam_lib.erl14
1 files changed, 9 insertions, 5 deletions
diff --git a/lib/stdlib/src/beam_lib.erl b/lib/stdlib/src/beam_lib.erl
index 9077e59fdc..e9a5e6831e 100644
--- a/lib/stdlib/src/beam_lib.erl
+++ b/lib/stdlib/src/beam_lib.erl
@@ -896,13 +896,17 @@ call_crypto_server(Req) ->
gen_server:call(?CRYPTO_KEY_SERVER, Req, infinity)
catch
exit:{noproc,_} ->
- start_crypto_server(),
- erlang:yield(),
- call_crypto_server(Req)
+ %% Not started.
+ call_crypto_server_1(Req);
+ exit:{normal,_} ->
+ %% The process finished just as we called it.
+ call_crypto_server_1(Req)
end.
-start_crypto_server() ->
- gen_server:start({local,?CRYPTO_KEY_SERVER}, ?MODULE, [], []).
+call_crypto_server_1(Req) ->
+ gen_server:start({local,?CRYPTO_KEY_SERVER}, ?MODULE, [], []),
+ erlang:yield(),
+ call_crypto_server(Req).
-spec init([]) -> {'ok', #state{}}.