From 896ed450c6607a1789b966a56dfc20f777755dab Mon Sep 17 00:00:00 2001 From: SisMaker <156736github> Date: Wed, 16 Feb 2022 23:59:32 +0800 Subject: [PATCH] =?UTF-8?q?pf=EF=BC=9Agen=5F*=E4=B8=8D=E8=83=BDcall?= =?UTF-8?q?=E8=87=AA=E5=B7=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/gen_call.erl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/gen_call.erl b/src/gen_call.erl index 04f48ac..3de9019 100644 --- a/src/gen_call.erl +++ b/src/gen_call.erl @@ -41,7 +41,12 @@ do_call(Process, Label, Request, Timeout) -> %% Local without timeout; no need to use alias since we unconditionally %% will wait for either a reply or a down message which corresponds to %% the process being terminated (as opposed to 'noconnection')... - Process ! {Label, {self(), Mref}, Request}, + case self() of + Process -> + exit(calling_self); + _ -> + Process ! {Label, {self(), Mref}, Request}, + end, receive {Mref, Reply} -> erlang:demonitor(Mref, [flush]),