aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/src/dialyzer_worker.erl
diff options
context:
space:
mode:
authorLuca Favatella <[email protected]>2015-09-25 00:02:51 +0100
committerHans Bolinder <[email protected]>2016-01-27 08:58:32 +0100
commit30361077904295cbc7471c44d4b15ae86bfb2f05 (patch)
tree9d7920fed0148aa75012965695f49d7b6faae755 /lib/dialyzer/src/dialyzer_worker.erl
parent7a2fc5f7ace6f0c3fc03e1f74f6cedf95c7968fd (diff)
downloadotp-30361077904295cbc7471c44d4b15ae86bfb2f05.tar.gz
otp-30361077904295cbc7471c44d4b15ae86bfb2f05.tar.bz2
otp-30361077904295cbc7471c44d4b15ae86bfb2f05.zip
Clarify usage of coordinator by analysis_callgraph
* Comment in dialyzer_analysis_callgraph what the call to dialyzer_coordinator does; * Delegate activation request to each dialyzer_worker; * There is no reason for the dialyzer_coordinator to request activation on behalf of the workers: let each worker request its own activation as it leads to more consistent dialyzer_worker module (activation is request as soon as status running is hit - reguardless of mode) and it reduces lines of code. * Clarify types in coordinator and worker e.g. make opaque and make type more strict.
Diffstat (limited to 'lib/dialyzer/src/dialyzer_worker.erl')
-rw-r--r--lib/dialyzer/src/dialyzer_worker.erl6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/dialyzer/src/dialyzer_worker.erl b/lib/dialyzer/src/dialyzer_worker.erl
index bae12b21c3..b9ab27c11d 100644
--- a/lib/dialyzer/src/dialyzer_worker.erl
+++ b/lib/dialyzer/src/dialyzer_worker.erl
@@ -25,7 +25,7 @@
-export_type([worker/0]).
--type worker() :: pid(). %%opaque
+-opaque worker() :: pid().
-type mode() :: dialyzer_coordinator:mode().
-type coordinator() :: dialyzer_coordinator:coordinator().
@@ -87,7 +87,7 @@ loop(waiting, #state{mode = Mode} = State) when
NewState = wait_for_success_typings(State),
loop(updating, NewState);
loop(running, #state{mode = 'compile'} = State) ->
- dialyzer_coordinator:wait_activation(),
+ dialyzer_coordinator:request_activation(State#state.coordinator),
?debug("Compile: ~s\n",[State#state.job]),
Result =
case start_compilation(State) of
@@ -99,7 +99,7 @@ loop(running, #state{mode = 'compile'} = State) ->
end,
report_to_coordinator(Result, State);
loop(running, #state{mode = 'warnings'} = State) ->
- dialyzer_coordinator:wait_activation(),
+ dialyzer_coordinator:request_activation(State#state.coordinator),
?debug("Warning: ~s\n",[State#state.job]),
Result = collect_warnings(State),
report_to_coordinator(Result, State);