aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2017-05-02 12:22:44 +0200
committerDan Gudmundsson <[email protected]>2017-05-02 12:22:44 +0200
commitdaca8c42a2ca170c0e187ad99203f2fa16d589eb (patch)
treef5df777a86dd2191f14d5ef9677eed578bc7ba67 /lib
parent3c483c22bb4701ee8a26b7324cd1a7a6c22448ce (diff)
downloadotp-daca8c42a2ca170c0e187ad99203f2fa16d589eb.tar.gz
otp-daca8c42a2ca170c0e187ad99203f2fa16d589eb.tar.bz2
otp-daca8c42a2ca170c0e187ad99203f2fa16d589eb.zip
Do not call which_applications()
Which may hang if an application start does wait for tables during initilization.
Diffstat (limited to 'lib')
-rw-r--r--lib/mnesia/src/mnesia_schema.erl18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/mnesia/src/mnesia_schema.erl b/lib/mnesia/src/mnesia_schema.erl
index b0d7965886..5f269a0826 100644
--- a/lib/mnesia/src/mnesia_schema.erl
+++ b/lib/mnesia/src/mnesia_schema.erl
@@ -866,18 +866,18 @@ list2cs(List, ExtTypes) when is_list(List) ->
is_list(DetsOpts) orelse mnesia:abort({badarg, Name, {dets, DetsOpts}}),
[CheckProp(Prop, BadDetsOpts) || Prop <- DetsOpts],
- case lists:keymember(mnesia, 1, application:which_applications()) of
- true ->
- Keys = check_keys(Name, List),
- check_duplicates(Name, Keys);
- false ->
+ case whereis(mnesia_controller) of
+ undefined ->
%% check_keys/2 cannot be executed when mnesia is not
%% running, due to it not being possible to read what ext
%% backends are loaded.
- %%% this doesn't work - disabled for now:
- %%%Keys = check_keys(Name, List, record_info(fields, cstruct)),
- %%%check_duplicates(Name, Keys)
- ignore
+ %% this doesn't work - disabled for now:
+ %%Keys = check_keys(Name, List, record_info(fields, cstruct)),
+ %%check_duplicates(Name, Keys)
+ ignore;
+ Pid when is_pid(Pid) ->
+ Keys = check_keys(Name, List),
+ check_duplicates(Name, Keys)
end,
Cs0 = #cstruct{name = Name,