diff options
author | Stavros Aronis <[email protected]> | 2012-02-23 13:46:51 +0100 |
---|---|---|
committer | Henrik Nord <[email protected]> | 2012-05-21 15:31:20 +0200 |
commit | dd1d17c1798a601dbe6378795c9a2fdd0effcc15 (patch) | |
tree | ae1412a05ddaf8ef4daa2fa22c765921729ed9bb /lib/dialyzer/src/dialyzer_worker.erl | |
parent | 44b23610234bf4028aedd326388bec503aee1026 (diff) | |
download | otp-dd1d17c1798a601dbe6378795c9a2fdd0effcc15.tar.gz otp-dd1d17c1798a601dbe6378795c9a2fdd0effcc15.tar.bz2 otp-dd1d17c1798a601dbe6378795c9a2fdd0effcc15.zip |
Worker PIDs are stored in an ETS table
Diffstat (limited to 'lib/dialyzer/src/dialyzer_worker.erl')
-rw-r--r-- | lib/dialyzer/src/dialyzer_worker.erl | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/lib/dialyzer/src/dialyzer_worker.erl b/lib/dialyzer/src/dialyzer_worker.erl index 74e227f587..37ca6854b1 100644 --- a/lib/dialyzer/src/dialyzer_worker.erl +++ b/lib/dialyzer/src/dialyzer_worker.erl @@ -101,7 +101,6 @@ loop(running, #state{mode = 'warnings'} = State) -> loop(running, #state{mode = Mode} = State) when Mode =:= 'typesig'; Mode =:= 'dataflow' -> ?debug("Run: ~p\n",[State#state.job]), - ok = ask_coordinator_for_callers(State), NotFixpoint = do_work(State), ok = broadcast_done(State), report_to_coordinator(NotFixpoint, State). @@ -112,29 +111,25 @@ waits_more_success_typings(#state{depends_on = Depends}) -> _ -> true end. -ask_coordinator_for_callers(#state{job = SCC, - servers = Servers, - coordinator = Coordinator}) -> +broadcast_done(#state{job = SCC, servers = Servers}) -> RequiredBy = dialyzer_succ_typings:find_required_by(SCC, Servers), - ?debug("Waiting for me~p: ~p\n",[SCC, RequiredBy]), - dialyzer_coordinator:sccs_to_pids_request(RequiredBy, Coordinator). - -broadcast_done(#state{job = SCC, coordinator = Coordinator}) -> - {Callers, Unknown} = dialyzer_coordinator:sccs_to_pids_reply(), + {Callers, Unknown} = dialyzer_coordinator:sccs_to_pids(RequiredBy), send_done(Callers, SCC), - continue_broadcast_done(Unknown, SCC, Coordinator). + continue_broadcast_done(Unknown, SCC). send_done(Callers, SCC) -> ?debug("Sending ~p: ~p\n",[SCC, Callers]), SendSTFun = fun(PID) -> PID ! {done, SCC} end, lists:foreach(SendSTFun, Callers). -continue_broadcast_done([], _SCC, _Coordinator) -> ok; -continue_broadcast_done(Rest, SCC, Coordinator) -> - dialyzer_coordinator:sccs_to_pids_request(Rest, Coordinator), - {Callers, Unknown} = dialyzer_coordinator:sccs_to_pids_reply(), +continue_broadcast_done([], _SCC) -> ok; +continue_broadcast_done(Rest, SCC) -> + %% This time limit should be greater than the time required + %% by the coordinator to spawn all processes. + timer:sleep(500), + {Callers, Unknown} = dialyzer_coordinator:sccs_to_pids(Rest), send_done(Callers, SCC), - continue_broadcast_done(Unknown, SCC, Coordinator). + continue_broadcast_done(Unknown, SCC). wait_for_success_typings(#state{depends_on = DependsOn} = State) -> receive |