diff options
author | Björn Gustavsson <[email protected]> | 2011-09-28 11:13:59 +0200 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2011-09-28 11:13:59 +0200 |
commit | be8538809c571441e6543a677db58501634b7572 (patch) | |
tree | 25b9229f4c16064d4831e357cb3dbde256331322 /lib/stdlib/src/beam_lib.erl | |
parent | 6bdf396b23219af136a217276308212913ca0aed (diff) | |
parent | b83073436a39553da458b19ef572ded9cd051611 (diff) | |
download | otp-be8538809c571441e6543a677db58501634b7572.tar.gz otp-be8538809c571441e6543a677db58501634b7572.tar.bz2 otp-be8538809c571441e6543a677db58501634b7572.zip |
Merge branch 'dev' into major
* dev:
distribution_SUITE:bulk_send_bigbig/1: Fail with more information
distribution_SUITE: Use unique slave node names
beam_lib: Handle rare race in the crypto key server functionality
busy_port_SUITE: Avoid crash in register/2
[wx] Re-generate code
[wx] Remove optional shadowing clauses
[wx] Remove warning
[wx] Fix trailing whitespace
[wx] Test colors in textctrl
[wx] Fix cleanup memory references
Diffstat (limited to 'lib/stdlib/src/beam_lib.erl')
-rw-r--r-- | lib/stdlib/src/beam_lib.erl | 14 |
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{}}. |