File 5071-stdlib-Add-comment-about-why-unlink-at-supervisor-sh.patch of Package erlang
From 7060581e7d0e87262670a9b8ceaa776f0aa9ac7b Mon Sep 17 00:00:00 2001
From: Lukas Larsson <lukas@erlang.org>
Date: Mon, 18 Oct 2021 09:33:36 +0200
Subject: [PATCH 01/11] stdlib: Add comment about why unlink at supervisor
shutdown
---
lib/stdlib/src/supervisor.erl | 2 ++
1 file changed, 2 insertions(+)
diff --git a/lib/stdlib/src/supervisor.erl b/lib/stdlib/src/supervisor.erl
index eea5b6a513..0d8b5a5ef4 100644
--- a/lib/stdlib/src/supervisor.erl
+++ b/lib/stdlib/src/supervisor.erl
@@ -967,6 +967,8 @@ shutdown(#child{pid=Pid, shutdown=Time} = Child) ->
end.
unlink_flush(Pid, DefaultReason) ->
+ %% We call unlink in order to guarantee that the 'EXIT' has arrived
+ %% from the dead process. See the unlink docs for details.
unlink(Pid),
receive
{'EXIT', Pid, Reason} ->
--
2.31.1