diff options
| author | Alexandru Scvortov <alexandru@rabbitmq.com> | 2011-09-15 10:23:12 +0100 |
|---|---|---|
| committer | Alexandru Scvortov <alexandru@rabbitmq.com> | 2011-09-15 10:23:12 +0100 |
| commit | 0a7fb6ac3d80589325912c9c9fc53a117eeb03df (patch) | |
| tree | c98bdd8551f20cdb4ff59e25ecf0a394532f22f1 | |
| parent | b91a3603c21bbf972dc4be5c959f288fc81c24ca (diff) | |
| download | rabbitmq-server-git-0a7fb6ac3d80589325912c9c9fc53a117eeb03df.tar.gz | |
refactor
| -rw-r--r-- | src/file2.erl | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/file2.erl b/src/file2.erl index 766c234055..d8b1a2acc7 100644 --- a/src/file2.erl +++ b/src/file2.erl @@ -883,24 +883,24 @@ mode_list(_) -> %% Functions for communicating with the file server call(Command, Args) when is_list(Args) -> - Pid = case whereis(serialiser) of + Pid = case whereis(file2_serialiser) of undefined -> start_serialiser(); Pid2 -> Pid2 end, - serialiser:submit( - Pid, - fun () -> - gen_server:call(?FILE_SERVER, list_to_tuple([Command | Args]), - infinity) - end). + serialiser:submit(Pid, {gen_server, call, + [?FILE_SERVER, list_to_tuple([Command | Args]), + infinity]}). start_serialiser() -> - {ok, Pid} = supervisor:start_child(kernel_sup, - {serialiser, {serialiser, start_link, []}, - permanent, 16#ffffffff, worker, - [serialiser]}), - true = register(serialiser, Pid), - Pid. + case supervisor:start_child(kernel_sup, + {file2_serialiser, + {serialiser, start_link, []}, + temporary, 16#ffffffff, worker, + [serialiser]}) of + {ok, Pid} -> true = register(file2_serialiser, Pid), + Pid; + {error, {already_started, Child}} -> Child + end. check_and_call(Command, Args) when is_list(Args) -> case check_args(Args) of |
