anchor.diff:                      %% from the graph.
                       digraph:del_vertex(G, Source),
                       mark_dirty(G),
  -                    populate_sources(G, Compiler, InDirs, Erls, DepOpts);
  +                    populate_sources(G, Compiler, InDirs, Erls, DepOpts, Waiting);
                   LastModified when LastUpdated < LastModified ->
                       digraph:add_vertex(G, Source, LastModified),
  -                    prepopulate_deps(G, Compiler, InDirs, Source, DepOpts, old),
  -                    mark_dirty(G);
  +                    Worker = prepopulate_deps(Compiler, InDirs, Source, DepOpts, self()),
  +                    populate_sources(G, Compiler, InDirs, Erls, DepOpts, Waiting#{Worker => {old, Source}});
                   _ -> % unchanged
  -                    ok
  +                    populate_sources(G, Compiler, InDirs, Erls, DepOpts, Waiting)
               end;
           false ->
               LastModified = filelib:last_modified(Source),
               digraph:add_vertex(G, Source, LastModified),
  -            prepopulate_deps(G, Compiler, InDirs, Source, DepOpts, new),
  -            mark_dirty(G)
  -    end,
  -    populate_sources(G, Compiler, InDirs, Erls, DepOpts).
  +            Worker = prepopulate_deps(Compiler, InDirs, Source, DepOpts, self()),
  +            populate_sources(G, Compiler, InDirs, Erls, DepOpts, Waiting#{Worker => {new, Source}})
  +    end.
   
   %% @doc Scan all files in the digraph that are seen as dependencies, but are
   %% neither source files nor artifacts (i.e. header files that don't produce
  
positive.code:             filter_prefix(G, AppPaths, FTail)
      end.
  
  %% @doc this function scans all the source files found and looks into
  %% all the `InDirs' for deps (other source files, or files that aren't source
  %% but still returned by the compiler module) that are related
  %% to them.
  populate_sources(_G, _Compiler, _InDirs, [], _DepOpts) ->
      ok;
  populate_sources(G, Compiler, InDirs, [Source|Erls], DepOpts) ->
      case digraph:vertex(G, Source) of
          {_, LastUpdated} ->
              case filelib:last_modified(Source) of
  
negative.code: %% mark its timestamp to 0, which means we have no info on it.
  %% Source files will be covered at a later point in their own scan, and
  %% non-source files are going to be covered by `populate_deps/3'.
  prepopulate_deps(Compiler, InDirs, Source, DepOpts, Control) ->
      {Worker, _MRef} = spawn_monitor(
          fun () ->
              SourceDir = filename:dirname(Source),
              AbsIncls = case erlang:function_exported(Compiler, dependencies, 4) of
                  false ->
                      Compiler:dependencies(Source, SourceDir, InDirs);
                  true ->
                      Compiler:dependencies(Source, SourceDir, InDirs, DepOpts)
              end,
              Control ! {deps, self(), AbsIncls}
          end
      ),
      Worker.
  
  %% check that a dep file is up to date
  refresh_dep(_G, {artifact, _}) ->
  