[erlang-questions] docs on group leaders?

Xavier Noria fxn@REDACTED
Thu Apr 5 00:47:09 CEST 2018


There it is, in application_master.erl

    kill_children(Children) ->
        lists:foreach(fun(Pid) -> exit(Pid, kill) end, Children),
        kill_all_procs().

    kill_all_procs() ->
        kill_all_procs_1(processes(), self(), 0).

    kill_all_procs_1([Self|Ps], Self, N) ->
        kill_all_procs_1(Ps, Self, N);
    kill_all_procs_1([P|Ps], Self, N) ->
        case process_info(P, group_leader) of
    {group_leader,Self} ->
        exit(P, kill),
        kill_all_procs_1(Ps, Self, N+1);
    _ ->
        kill_all_procs_1(Ps, Self, N)
        end;
    kill_all_procs_1([], _, 0) -> ok;
    kill_all_procs_1([], _, _) -> kill_all_procs().

I read this file from top to bottom in the last months to do some
groundwork, perhaps it was there that I saw the grouping trick instead of
reading it in prose.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180405/b9b3715c/attachment.htm>


More information about the erlang-questions mailing list