aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2016-02-01 12:19:13 +0100
committerBjörn Gustavsson <[email protected]>2016-02-01 12:19:13 +0100
commit5dac3400b00e499cb7c436b6b71c510c718d92cf (patch)
treebb40c601d974829a60b8e469ed17dc8e66cf261f
parent57a928b4bc1076b169ecc95e38ab23cf79e03280 (diff)
parent901b9703c898be4e6fd5a797a4b304bccafeee4b (diff)
downloadotp-5dac3400b00e499cb7c436b6b71c510c718d92cf.tar.gz
otp-5dac3400b00e499cb7c436b6b71c510c718d92cf.tar.bz2
otp-5dac3400b00e499cb7c436b6b71c510c718d92cf.zip
Merge branch 'lrascao/stdlib/beam_lib-race-condition/OTP-13278' into maint
* lrascao/stdlib/beam_lib-race-condition/OTP-13278: Check for already started beam_lib crypto server
-rw-r--r--lib/stdlib/src/beam_lib.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/stdlib/src/beam_lib.erl b/lib/stdlib/src/beam_lib.erl
index cbbab088f4..503a2b416f 100644
--- a/lib/stdlib/src/beam_lib.erl
+++ b/lib/stdlib/src/beam_lib.erl
@@ -931,7 +931,10 @@ call_crypto_server(Req) ->
end.
call_crypto_server_1(Req) ->
- {ok, _} = gen_server:start({local,?CRYPTO_KEY_SERVER}, ?MODULE, [], []),
+ case gen_server:start({local,?CRYPTO_KEY_SERVER}, ?MODULE, [], []) of
+ {ok, _} -> ok;
+ {error, {already_started, _}} -> ok
+ end,
erlang:yield(),
call_crypto_server(Req).