summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Radestock <matthias@rabbitmq.com>2013-01-27 19:29:40 +0000
committerMatthias Radestock <matthias@rabbitmq.com>2013-01-27 19:29:40 +0000
commitaefbad458fa089f1f5f9d29d4e39d97b1097695f (patch)
tree9a90192176db225e68fea20fa090e73d4fec0071
parente1ac8e04de996a44e98ae403c74b5bc59a0f181c (diff)
downloadrabbitmq-server-git-aefbad458fa089f1f5f9d29d4e39d97b1097695f.tar.gz
move find_child implementation to a better place
-rw-r--r--src/supervisor2.erl18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/supervisor2.erl b/src/supervisor2.erl
index a762defaa7..1f1f924653 100644
--- a/src/supervisor2.erl
+++ b/src/supervisor2.erl
@@ -285,6 +285,15 @@ which_children(Supervisor) ->
count_children(Supervisor) ->
call(Supervisor, count_children).
+-ifdef(use_specs).
+-spec find_child(Supervisor, Name) -> [pid()] when
+ Supervisor :: sup_ref(),
+ Name :: child_id().
+-endif.
+find_child(Supervisor, Name) ->
+ [Pid || {Name1, Pid, _Type, _Modules} <- which_children(Supervisor),
+ Name1 =:= Name].
+
call(Supervisor, Req) ->
gen_server:call(Supervisor, Req, infinity).
@@ -313,15 +322,6 @@ try_again_restart(Supervisor, Child) ->
cast(Supervisor, Req) ->
gen_server:cast(Supervisor, Req).
--ifdef(use_specs).
--spec find_child(Supervisor, Name) -> [pid()] when
- Supervisor :: sup_ref(),
- Name :: child_id().
--endif.
-find_child(Supervisor, Name) ->
- [Pid || {Name1, Pid, _Type, _Modules} <- which_children(Supervisor),
- Name1 =:= Name].
-
%%% ---------------------------------------------------
%%%
%%% Initialize the supervisor.