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
commit4c8ed37e06d15e5c62b211b5d129ed72059d0b51 (patch)
tree9a90192176db225e68fea20fa090e73d4fec0071
parent0f26c7ae57c04790b3275d85bf45b5d3717bca19 (diff)
downloadrabbitmq-server-4c8ed37e06d15e5c62b211b5d129ed72059d0b51.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 a762defa..1f1f9246 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.