summaryrefslogtreecommitdiff
path: root/src/file2.erl
diff options
context:
space:
mode:
Diffstat (limited to 'src/file2.erl')
-rw-r--r--src/file2.erl14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/file2.erl b/src/file2.erl
index 4d945fc4a2..bcae00a340 100644
--- a/src/file2.erl
+++ b/src/file2.erl
@@ -900,13 +900,25 @@ mode_list(_) ->
%% Functions for communicating with the file server
call(Command, Args) when is_list(Args) ->
+ Pid = case whereis(serialiser) of
+ undefined -> start_serialiser();
+ Pid2 -> Pid2
+ end,
serialiser:submit(
- serialiser,
+ Pid,
fun () ->
gen_server:call(?FILE_SERVER, list_to_tuple([Command | Args]),
infinity)
end).
+start_serialiser() ->
+ {ok, Pid} = supervisor:start_child(kernel_sup,
+ {serialiser, {serialiser, start_link, []},
+ permanent, 16#ffffffff, worker,
+ [serialiser]}),
+ true = register(serialiser, Pid),
+ Pid.
+
check_and_call(Command, Args) when is_list(Args) ->
case check_args(Args) of
ok ->