aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2010-10-14 15:59:54 +0200
committerBjörn Gustavsson <[email protected]>2010-10-14 15:59:54 +0200
commit163f5e36779e2a5f6d19fd80578ddd293dc76dd8 (patch)
tree24026a4850d0209549636a3c65cedafa30e22b50 /lib
parentc70566c96e604bbef3e202e868f225ab5e77b366 (diff)
parent759f90b8e58ee272e82837329b9dff3ca21ede4c (diff)
downloadotp-163f5e36779e2a5f6d19fd80578ddd293dc76dd8.tar.gz
otp-163f5e36779e2a5f6d19fd80578ddd293dc76dd8.tar.bz2
otp-163f5e36779e2a5f6d19fd80578ddd293dc76dd8.zip
Merge branch 'ks/supervisor-export-types' into dev
* ks/supervisor-export-types: supervisor: Type and spec related changes
Diffstat (limited to 'lib')
-rw-r--r--lib/stdlib/src/supervisor.erl14
1 files changed, 11 insertions, 3 deletions
diff --git a/lib/stdlib/src/supervisor.erl b/lib/stdlib/src/supervisor.erl
index f5d5441184..5bdd1a8672 100644
--- a/lib/stdlib/src/supervisor.erl
+++ b/lib/stdlib/src/supervisor.erl
@@ -33,7 +33,9 @@
-export([init/1, handle_call/3, handle_info/2, terminate/2, code_change/3]).
-export([handle_cast/2]).
--export_type([child_spec/0, strategy/0]).
+%%--------------------------------------------------------------------------
+
+-export_type([child_spec/0, del_err/0, startchild_ret/0, strategy/0]).
%%--------------------------------------------------------------------------
@@ -77,6 +79,10 @@
-define(is_simple(State), State#state.strategy =:= simple_one_for_one).
+%%--------------------------------------------------------------------------
+
+-spec behaviour_info(atom()) -> 'undefined' | [{atom(), arity()}].
+
behaviour_info(callbacks) ->
[{init,1}];
behaviour_info(_Other) ->
@@ -160,11 +166,13 @@ check_childspecs(X) -> {error, {badarg, X}}.
%%%
%%% ---------------------------------------------------
+-type init_sup_name() :: sup_name() | 'self'.
+
-type stop_rsn() :: 'shutdown' | {'bad_return', {module(),'init', term()}}
| {'bad_start_spec', term()} | {'start_spec', term()}
| {'supervisor_data', term()}.
--spec init({sup_name(), module(), [term()]}) ->
+-spec init({init_sup_name(), module(), [term()]}) ->
{'ok', state()} | 'ignore' | {'stop', stop_rsn()}.
init({SupName, Mod, Args}) ->
@@ -184,7 +192,7 @@ init({SupName, Mod, Args}) ->
Error ->
{stop, {bad_return, {Mod, init, Error}}}
end.
-
+
init_children(State, StartSpec) ->
SupName = State#state.name,
case check_startspec(StartSpec) of