Skip to content

Commit 28790df

Browse files
Gazlerjosevalim
authored andcommitted
Fix parallel compiler to only send found message once (#4777)
When a module waits a struct, only the module or struct found message will be sent, not both.
1 parent 1eda812 commit 28790df

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/elixir/lib/kernel/parallel_compiler.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ defmodule Kernel.ParallelCompiler do
176176
# Release the module loader which is waiting for an ack
177177
send child, {ref, :ack}
178178

179-
available = for {_kind, pid, _, waiting_module, _defining} <- waiting,
179+
available = for {:module, pid, _, waiting_module, _defining} <- waiting,
180180
module == waiting_module,
181181
do: {pid, :found}
182182

@@ -185,7 +185,7 @@ defmodule Kernel.ParallelCompiler do
185185
spawn_compilers(%{state | entries: available ++ entries, result: [{:module, module} | result]})
186186

187187
{:waiting, kind, child, ref, on, defining} ->
188-
defined = fn {k, m} -> on == m and k in [kind, :module] end
188+
defined = fn {k, m} -> on == m and k == kind end
189189

190190
# Oops, we already got it, do not put it on waiting.
191191
waiting =

0 commit comments

Comments
 (0)