Skip to content

Commit c9458a0

Browse files
committed
Rename it __alias__
1 parent 8c20fd3 commit c9458a0

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

lib/elixir/lib/task.ex

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,16 +1444,20 @@ defmodule Task do
14441444
end
14451445
end
14461446

1447+
# exported only to avoid dialyzer opaqueness check in internal Task modules
1448+
@doc false
1449+
@spec __alias__(pid()) :: Task.ref()
1450+
def __alias__(pid) do
1451+
build_alias(pid)
1452+
end
1453+
14471454
## Optimizations
14481455

14491456
defp build_monitor(pid) do
14501457
:erlang.monitor(:process, pid)
14511458
end
14521459

1453-
# exported only to avoid dialyzer opaqueness check in internal Task modules
1454-
@doc false
1455-
@spec build_alias(pid()) :: Task.ref()
1456-
def build_alias(pid) do
1460+
defp build_alias(pid) do
14571461
:erlang.monitor(:process, pid, alias: :demonitor)
14581462
end
14591463

lib/elixir/lib/task/supervisor.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -614,7 +614,7 @@ defmodule Task.Supervisor do
614614
case start_child_with_spec(supervisor, [get_owner(owner), :monitor], :temporary, shutdown) do
615615
{:ok, pid} ->
616616
if link_type == :link, do: Process.link(pid)
617-
alias = Task.build_alias(pid)
617+
alias = Task.__alias__(pid)
618618
send(pid, {owner, alias, alias, get_callers(owner), {module, fun, args}})
619619
%Task{pid: pid, ref: alias, owner: owner, mfa: {module, fun, length(args)}}
620620

0 commit comments

Comments
 (0)