 
       {:timed_out, child} ->
         case List.keyfind(files, child, 0) do
-          {^child, _, file, _} ->
-            state.each_long_compilation.(file)
-
-          _ ->
-            :ok
+          {^child, _, file, _} -> state.each_long_compilation.(file)
+          _ -> :ok
         end
 
         spawn_workers(queue, spawned, waiting, files, result, warnings, state)

        send(child_pid, ref)
        cancel_waiting_timer(files, child_pid)

        # Sometimes we may have spurious entries in the waiting list
        # because someone invoked try/rescue UndefinedFunctionError
        discard_down(child_pid)
        new_queue = List.delete(queue, child_pid)
        new_files = List.keydelete(files, child_pid, 0)
        new_waiting = List.keydelete(waiting, child_pid, 1)
        spawn_workers(new_queue, spawned - 1, new_waiting, new_files, result, warnings, state)

      {:file_error, child_pid, file, {kind, reason, stack}} ->
        print_error(file, kind, reason, stack)

    parent = self()
    file = Path.expand(file)

    {pid, ref} =
      :erlang.spawn_monitor(fn ->
        :erlang.put(:elixir_compiler_pid, parent)
        :erlang.put(:elixir_compiler_file, file)

        try do
          case output do
            {:compile, path} ->
              :erlang.process_flag(:error_handler, Kernel.ErrorHandler)
              :erlang.put(:elixir_compiler_dest, path)
              :elixir_compiler.file_to_path(file, path, &each_file(&1, &2, parent))

            :compile ->
              :erlang.process_flag(:error_handler, Kernel.ErrorHandler)
              :erlang.put(:elixir_compiler_dest, dest)
              :elixir_compiler.file(file, &each_file(&1, &2, parent))

            :require ->
              case :elixir_code_server.call({:acquire, file}) do
                :required ->
                  send(parent, {:file_cancel, self()})

                :proceed ->
                  :elixir_compiler.file(file, &each_file(&1, &2, parent))
                  :elixir_code_server.cast({:required, file})
              end
          end
        catch
          kind, reason ->
            send(parent, {:file_error, self(), file, {kind, reason, __STACKTRACE__}})
        end

        exit(:shutdown)
      end)

    timer_ref = Process.send_after(self(), {:timed_out, pid}, threshold * 1000)
    files = [{pid, ref, file, timer_ref} | files]
    spawn_workers(queue, spawned + 1, waiting, files, result, warnings, state)
  end

  # No more queue, nothing waiting, this cycle is done
