Skip to content

Commit 8cb8445

Browse files
committed
Fix supervisor:terminate/2 spec, add terminate_children/2 spec
`terminate_dynamic_children/1` returns `ok` from `maps:foreach(...)`, which matches the spec, but `terminate_children/2`, itself lacking a spec, returns `NChildren` returned by `children_map/2`.
1 parent d6df2ca commit 8cb8445

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

lib/stdlib/src/supervisor.erl

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,7 +1292,7 @@ handle_info(Msg, State) ->
12921292
%% Terminate this server.
12931293
%%
12941294
-doc false.
1295-
-spec terminate(term(), state()) -> 'ok'.
1295+
-spec terminate(term(), state()) -> term().
12961296

12971297
terminate(_Reason, State) when ?is_simple(State) ->
12981298
terminate_dynamic_children(State);
@@ -1558,13 +1558,8 @@ restarting(RPid) -> RPid.
15581558
try_again_restart(TryAgainId, Tag) ->
15591559
gen_server:cast(self(), {try_again_restart, Tag, TryAgainId}).
15601560

1561-
%%-----------------------------------------------------------------
1562-
%% Func: terminate_children/2
1563-
%% Args: Children = children() % Ids in termination order
1564-
%% SupName = {local, atom()} | {global, term()} | {pid(),Mod}
1565-
%% Returns: NChildren = children() % Ids in startup order
1566-
%% % (reversed termination order)
1567-
%%-----------------------------------------------------------------
1561+
-spec terminate_children(children(), SupName) -> children() when
1562+
SupName :: {local, atom()} | {global, term()} | {pid(), module()}.
15681563
terminate_children(Children, SupName) ->
15691564
Terminate =
15701565
fun(_Id,Child) when ?is_temporary(Child) ->

0 commit comments

Comments
 (0)