瀏覽代碼

ft: M F A添加 代码优化

master
SisMaker 3 年之前
父節點
當前提交
33321b08f1
共有 5 個檔案被更改,包括 173 行新增111 行删除
  1. +33
    -39
      src/gen_apu.erl
  2. +12
    -2
      src/gen_call.erl
  3. +5
    -18
      src/gen_emm.erl
  4. +6
    -24
      src/gen_ipc.erl
  5. +117
    -28
      src/gen_srv.erl

+ 33
- 39
src/gen_apu.erl 查看文件

@ -352,6 +352,7 @@ call(ServerRef, Request, Timeout) ->
erlang:raise(Class, {Reason, {?MODULE, call, [ServerRef, Request]}}, ?STACKTRACE())
end.
-spec clfn(ServerRef :: serverRef(), M :: module(), F :: atom(), A :: list()) -> ok.
clfn(ServerRef, M, F, A) ->
try gen_call:call(ServerRef, '$gen_clfn', {M, F, A}) of
{ok, Reply} ->
@ -360,6 +361,7 @@ clfn(ServerRef, M, F, A) ->
erlang:raise(Class, {Reason, {?MODULE, clfn, [ServerRef, {M, F, A}]}}, ?STACKTRACE())
end.
-spec clfn(ServerRef :: serverRef(), M :: module(), F :: atom(), A :: list(), Timeout :: timeout()) -> ok.
clfn(ServerRef, M, F, A, Timeout) ->
try gen_call:call(ServerRef, '$gen_clfn', {M, F, A}, Timeout) of
{ok, Reply} ->
@ -368,6 +370,7 @@ clfn(ServerRef, M, F, A, Timeout) ->
erlang:raise(Class, {Reason, {?MODULE, clfn, [ServerRef, {M, F, A}]}}, ?STACKTRACE())
end.
-spec clfs(ServerRef :: serverRef(), M :: module(), F :: atom(), A :: list()) -> ok.
clfs(ServerRef, M, F, A) ->
try gen_call:call(ServerRef, '$gen_clfs', {M, F, A}) of
{ok, Reply} ->
@ -376,6 +379,7 @@ clfs(ServerRef, M, F, A) ->
erlang:raise(Class, {Reason, {?MODULE, clfs, [ServerRef, {M, F, A}]}}, ?STACKTRACE())
end.
-spec clfs(ServerRef :: serverRef(), M :: module(), F :: atom(), A :: list(), Timeout :: timeout()) -> ok.
clfs(ServerRef, M, F, A, Timeout) ->
try gen_call:call(ServerRef, '$gen_clfs', {M, F, A}, Timeout) of
{ok, Reply} ->
@ -384,7 +388,7 @@ clfs(ServerRef, M, F, A, Timeout) ->
erlang:raise(Class, {Reason, {?MODULE, clfs, [ServerRef, {M, F, A}]}}, ?STACKTRACE())
end.
-spec csfn(ServerRef :: serverRef(), Msg :: term()) -> ok.
-spec csfn(ServerRef :: serverRef(), M :: module(), F :: atom(), A :: list()) -> ok.
csfn({global, Name}, M, F, A) ->
try global:send(Name, {'$gen_csfn', {M, F, A}}),
ok
@ -401,7 +405,7 @@ csfn(Dest, M, F, A) ->
catch _:_ -> ok
end.
-spec csfs(ServerRef :: serverRef(), Msg :: term()) -> ok.
-spec csfs(ServerRef :: serverRef(), M :: module(), F :: atom(), A :: list()) -> ok.
csfs({global, Name}, M, F, A) ->
try global:send(Name, {'$gen_csfs', {M, F, A}}),
ok
@ -534,9 +538,6 @@ doAbcast(Nodes, Name, Msg) ->
],
ok.
%% -----------------------------------------------------------------
%% Send a reply to the client.
%% -----------------------------------------------------------------
%% Reply from a status machine callback to whom awaits in call/2
-spec reply([replyAction(), ...] | replyAction()) -> ok.
reply({reply, {To, Tag}, Reply}) ->
@ -546,27 +547,13 @@ reply({reply, {To, Tag}, Reply}) ->
ok
end;
reply(Replies) when is_list(Replies) ->
[
begin
try To ! {Tag, Reply},
ok
catch _:_ ->
ok
end
end || {reply, {To, Tag}, Reply} <- Replies
],
[gen_call:reply(From, Reply) || {reply, From, Reply} <- Replies],
ok.
-compile({inline, [reply/2]}).
-spec reply(From :: from(), Reply :: term()) -> ok.
reply({_To, [alias | Alias] = Tag}, Reply) ->
Alias ! {Tag, Reply},
ok;
reply({To, Tag}, Reply) ->
try To ! {Tag, Reply},
ok
catch _:_ ->
ok
end.
reply(From, Reply) ->
gen_call:reply(From, Reply).
%% -----------------------------------------------------------------
%% Send a request to a generic server and return a Key which should be
@ -723,14 +710,14 @@ receiveIng(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState,
matchCallMsg(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, From, Request);
{'$gen_cast', Cast} ->
matchCastMsg(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, Cast);
{'gen_clfn', MFA} ->
matchMFA(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, MFA, false);
{'gen_clfs', MFA} ->
matchMFA(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, MFA, true);
{'gen_clfn', From, MFA} ->
matchMFA(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, From, MFA, false);
{'gen_clfs', From, MFA} ->
matchMFA(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, From, MFA, true);
{'gen_csfn', MFA} ->
matchMFA(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, MFA, false);
matchMFA(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, false, MFA, false);
{'gen_csfs', MFA} ->
matchMFA(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, MFA, true);
matchMFA(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, false, MFA, true);
{timeout, TimerRef, TimeoutName} ->
case Timers of
#{TimeoutName := {TimerRef, TimeoutMsg}} ->
@ -763,10 +750,10 @@ matchCallMsg(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurStat
end
of
Result ->
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, From)
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, From, false)
catch
throw:Result ->
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, From);
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, From, false);
Class:Reason:Strace ->
terminate(Class, Reason, Strace, Name, Module, NewDebug, Timers, CurState, {{call, From}, Request})
end.
@ -783,15 +770,15 @@ matchCastMsg(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurStat
end
of
Result ->
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, false)
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, false, false)
catch
throw:Result ->
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, false);
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, false, false);
Class:Reason:Strace ->
terminate(Class, Reason, Strace, Name, Module, NewDebug, Timers, CurState, {cast, Cast})
end.
matchMFA(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, MFA, IsWithState) ->
matchMFA(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, From, MFA, IsWithState) ->
NewDebug = ?SYS_DEBUG(Debug, Name, {in, {mfa, MFA}}),
try
{M, F, A} = MFA,
@ -803,10 +790,10 @@ matchMFA(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, M
end
of
Result ->
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, false)
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, From, true)
catch
throw:Result ->
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, false);
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, From, true);
Class:Reason:Strace ->
terminate(Class, Reason, Strace, Name, Module, NewDebug, Timers, CurState, {mfa, MFA})
end.
@ -815,10 +802,10 @@ matchInfoMsg(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurStat
NewDebug = ?SYS_DEBUG(Debug, Name, {in, {info, Msg}}),
try Module:handleInfo(Msg, CurState) of
Result ->
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, false)
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, false, false)
catch
throw:Result ->
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, false);
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, false, false);
Class:Reason:Strace ->
terminate(Class, Reason, Strace, Name, Module, NewDebug, Timers, CurState, {info, Msg})
end.
@ -835,7 +822,7 @@ doAfterCall(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState
terminate(Class, Reason, Strace, Name, Module, NewDebug, Timers, CurState, {doAfter, Args})
end.
handleCR(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, Result, From) ->
handleCR(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, Result, From, IsAnyRet) ->
case Result of
kpS ->
receiveIng(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, false);
@ -863,6 +850,13 @@ handleCR(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, R
terminate(exit, Reason, ?STACKTRACE(), Name, Module, NewDebug, Timers, NewState, {return, stop_reply})
after
_ = reply(From, Reply)
end;
_AnyRet ->
case IsAnyRet of
true ->
receiveIng(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, false);
_ ->
terminate(exit, bad_ret, ?STACKTRACE(), Name, Module, Debug, Timers, CurState, {return, _AnyRet})
end
end.

+ 12
- 2
src/gen_call.erl 查看文件

@ -1,6 +1,6 @@
-module(gen_call).
-export([call/3, call/4]).
-export([call/3, call/4, reply/2]).
-define(default_timeout, 5000).
@ -111,4 +111,14 @@ where(Name) ->
whereis(Name);
true ->
undefined
end.
end.
%%
%% Send a reply to the client.
%%
reply({_To, [alias | Alias] = Tag}, Reply) when is_reference(Alias) ->
Alias ! {Tag, Reply}, ok;
reply({_To, [[alias | Alias] | _] = Tag}, Reply) when is_reference(Alias) ->
Alias ! {Tag, Reply}, ok;
reply({To, Tag}, Reply) ->
try To ! {Tag, Reply}, ok catch _:_ -> ok end.

+ 5
- 18
src/gen_emm.erl 查看文件

@ -685,28 +685,15 @@ epmTerminate(#epmHer{epmM = EpmM, epmS = State} = EpmHer, Args, LastIn, Reason)
ok
end.
-compile({inline, [reply/2]}).
-spec reply(From :: from(), Reply :: term()) -> ok.
reply({_To, [alias|Alias] = Tag}, Reply) ->
Alias ! {Tag, Reply},
ok;
reply({To, Ref}, Msg) ->
try To ! {Ref, Msg},
ok
catch _:_ ->
ok
end.
reply(From, Reply) ->
gen_call:reply(From, Reply).
try_reply(false, _Msg) ->
ignore;
try_reply({_To, [alias|Alias] = Tag}, Reply) ->
Alias ! {Tag, Reply},
ok;
try_reply({To, Ref}, Msg) ->
try To ! {Ref, Msg},
ok
catch _:_ ->
ok
end.
try_reply(From, Reply) ->
gen_call:reply(From, Reply).
terminate_server(Reason, _Parent, _ServerName, EpmHers) ->
epmStopAll(EpmHers),

+ 6
- 24
src/gen_ipc.erl 查看文件

@ -782,36 +782,18 @@ reply({reply, {To, Tag}, Reply}) ->
ok
end;
reply(Replies) when is_list(Replies) ->
[
begin
try To ! {Tag, Reply},
ok
catch _:_ ->
ok
end
end || {reply, {To, Tag}, Reply} <- Replies
],
[gen_call:reply(From, Reply) || {reply, From, Reply} <- Replies],
ok.
-compile({inline, [reply/2]}).
-spec reply(From :: from(), Reply :: term()) -> ok.
reply({_To, [alias|Alias] = Tag}, Reply) ->
Alias ! {Tag, Reply},
ok;
reply({To, Tag}, Reply) ->
try To ! {Tag, Reply},
ok
catch _:_ ->
ok
end.
reply(From, Reply) ->
gen_call:reply(From, Reply).
try_reply(false, _Msg) ->
ignore;
try_reply({To, Ref}, Msg) ->
try To ! {Ref, Msg},
ok
catch _:_ ->
ok
end.
try_reply(From, Reply) ->
gen_call:reply(From, Reply).
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% API helpers end %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% gen_event start %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

+ 117
- 28
src/gen_srv.erl 查看文件

@ -11,6 +11,7 @@
, start_monitor/3, start_monitor/4
, stop/1, stop/3
, call/2, call/3
, clfn/4, clfn/5, clfs/4, clfs/5, csfn/4, csfs/4
, send_request/2, wait_response/2, receive_response/2, check_response/2
, cast/2, send/2, reply/1, reply/2
, abcast/2, abcast/3
@ -347,6 +348,76 @@ call(ServerRef, Request, Timeout) ->
erlang:raise(Class, {Reason, {?MODULE, call, [ServerRef, Request]}}, ?STACKTRACE())
end.
-spec clfn(ServerRef :: serverRef(), M :: module(), F :: atom(), A :: list()) -> ok.
clfn(ServerRef, M, F, A) ->
try gen_call:call(ServerRef, '$gen_clfn', {M, F, A}) of
{ok, Reply} ->
Reply
catch Class:Reason ->
erlang:raise(Class, {Reason, {?MODULE, clfn, [ServerRef, {M, F, A}]}}, ?STACKTRACE())
end.
-spec clfn(ServerRef :: serverRef(), M :: module(), F :: atom(), A :: list(), Timeout :: timeout()) -> ok.
clfn(ServerRef, M, F, A, Timeout) ->
try gen_call:call(ServerRef, '$gen_clfn', {M, F, A}, Timeout) of
{ok, Reply} ->
Reply
catch Class:Reason ->
erlang:raise(Class, {Reason, {?MODULE, clfn, [ServerRef, {M, F, A}]}}, ?STACKTRACE())
end.
-spec clfs(ServerRef :: serverRef(), M :: module(), F :: atom(), A :: list()) -> ok.
clfs(ServerRef, M, F, A) ->
try gen_call:call(ServerRef, '$gen_clfs', {M, F, A}) of
{ok, Reply} ->
Reply
catch Class:Reason ->
erlang:raise(Class, {Reason, {?MODULE, clfs, [ServerRef, {M, F, A}]}}, ?STACKTRACE())
end.
-spec clfs(ServerRef :: serverRef(), M :: module(), F :: atom(), A :: list(), Timeout :: timeout()) -> ok.
clfs(ServerRef, M, F, A, Timeout) ->
try gen_call:call(ServerRef, '$gen_clfs', {M, F, A}, Timeout) of
{ok, Reply} ->
Reply
catch Class:Reason ->
erlang:raise(Class, {Reason, {?MODULE, clfs, [ServerRef, {M, F, A}]}}, ?STACKTRACE())
end.
-spec csfn(ServerRef :: serverRef(), M :: module(), F :: atom(), A :: list()) -> ok.
csfn({global, Name}, M, F, A) ->
try global:send(Name, {'$gen_csfn', {M, F, A}}),
ok
catch _:_ -> ok
end;
csfn({via, RegMod, Name}, M, F, A) ->
try RegMod:send(Name, {'$gen_csfn', {M, F, A}}),
ok
catch _:_ -> ok
end;
csfn(Dest, M, F, A) ->
try erlang:send(Dest, {'$gen_csfn', {M, F, A}}),
ok
catch _:_ -> ok
end.
-spec csfs(ServerRef :: serverRef(), M :: module(), F :: atom(), A :: list()) -> ok.
csfs({global, Name}, M, F, A) ->
try global:send(Name, {'$gen_csfs', {M, F, A}}),
ok
catch _:_ -> ok
end;
csfs({via, RegMod, Name}, M, F, A) ->
try RegMod:send(Name, {'$gen_csfs', {M, F, A}}),
ok
catch _:_ -> ok
end;
csfs(Dest, M, F, A) ->
try erlang:send(Dest, {'$gen_csfs', {M, F, A}}),
ok
catch _:_ -> ok
end.
%%% -----------------------------------------------------------------
%%% Make a call to servers at several nodes.
%%% Returns: {[Replies],[BadNodes]}
@ -463,9 +534,6 @@ doAbcast(Nodes, Name, Msg) ->
],
ok.
%% -----------------------------------------------------------------
%% Send a reply to the client.
%% -----------------------------------------------------------------
%% Reply from a status machine callback to whom awaits in call/2
-spec reply([replyAction(), ...] | replyAction()) -> ok.
reply({reply, {To, Tag}, Reply}) ->
@ -475,27 +543,13 @@ reply({reply, {To, Tag}, Reply}) ->
ok
end;
reply(Replies) when is_list(Replies) ->
[
begin
try To ! {Tag, Reply},
ok
catch _:_ ->
ok
end
end || {reply, {To, Tag}, Reply} <- Replies
],
[gen_call:reply(From, Reply) || {reply, From, Reply} <- Replies],
ok.
-compile({inline, [reply/2]}).
-spec reply(From :: from(), Reply :: term()) -> ok.
reply({_To, [alias|Alias] = Tag}, Reply) ->
Alias ! {Tag, Reply},
ok;
reply({To, Tag}, Reply) ->
try To ! {Tag, Reply},
ok
catch _:_ ->
ok
end.
reply(From, Reply) ->
gen_call:reply(From, Reply).
%% -----------------------------------------------------------------
%% Send a request to a generic server and return a Key which should be
@ -652,6 +706,14 @@ receiveIng(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState,
matchCallMsg(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, From, Request);
{'$gen_cast', Cast} ->
matchCastMsg(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, Cast);
{'gen_clfn', From, MFA} ->
matchMFA(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, From, MFA, false);
{'gen_clfs', From, MFA} ->
matchMFA(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, From, MFA, true);
{'gen_csfn', MFA} ->
matchMFA(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, false, MFA, false);
{'gen_csfs', MFA} ->
matchMFA(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, false, MFA, true);
{timeout, TimerRef, TimeoutName} ->
case Timers of
#{TimeoutName := {TimerRef, TimeoutMsg}} ->
@ -676,10 +738,10 @@ matchCallMsg(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurStat
NewDebug = ?SYS_DEBUG(Debug, Name, {in, {{call, From}, Request}}),
try Module:handleCall(Request, CurState, From) of
Result ->
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, From)
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, From, false)
catch
throw:Result ->
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, From);
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, From, false);
Class:Reason:Strace ->
terminate(Class, Reason, Strace, Name, Module, NewDebug, Timers, CurState, {{call, From}, Request})
end.
@ -688,22 +750,42 @@ matchCastMsg(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurStat
NewDebug = ?SYS_DEBUG(Debug, Name, {in, {cast, Cast}}),
try Module:handleCast(Cast, CurState) of
Result ->
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, false)
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, false, false)
catch
throw:Result ->
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, false);
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, false, false);
Class:Reason:Strace ->
terminate(Class, Reason, Strace, Name, Module, NewDebug, Timers, CurState, {cast, Cast})
end.
matchMFA(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, From, MFA, IsWithState) ->
NewDebug = ?SYS_DEBUG(Debug, Name, {in, {mfa, MFA}}),
try
{M, F, A} = MFA,
case IsWithState of
true ->
erlang:apply(M, F, A ++ [CurState]);
_ ->
erlang:apply(M, F, A)
end
of
Result ->
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, From, true)
catch
throw:Result ->
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, From, true);
Class:Reason:Strace ->
terminate(Class, Reason, Strace, Name, Module, NewDebug, Timers, CurState, {mfa, MFA})
end.
matchInfoMsg(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, Msg) ->
NewDebug = ?SYS_DEBUG(Debug, Name, {in, {info, Msg}}),
try Module:handleInfo(Msg, CurState) of
Result ->
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, false)
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, false, false)
catch
throw:Result ->
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, false);
handleCR(Parent, Name, Module, HibernateAfterTimeout, NewDebug, Timers, CurState, Result, false, false);
Class:Reason:Strace ->
terminate(Class, Reason, Strace, Name, Module, NewDebug, Timers, CurState, {info, Msg})
end.
@ -720,7 +802,7 @@ doAfterCall(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState
terminate(Class, Reason, Strace, Name, Module, NewDebug, Timers, CurState, {doAfter, Args})
end.
handleCR(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, Result, From) ->
handleCR(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, Result, From, IsAnyRet) ->
case Result of
kpS ->
receiveIng(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, false);
@ -748,6 +830,13 @@ handleCR(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, R
terminate(exit, Reason, ?STACKTRACE(), Name, Module, NewDebug, Timers, NewState, {return, stop_reply})
after
_ = reply(From, Reply)
end;
_AnyRet ->
case IsAnyRet of
true ->
receiveIng(Parent, Name, Module, HibernateAfterTimeout, Debug, Timers, CurState, false);
_ ->
terminate(exit, bad_ret, ?STACKTRACE(), Name, Module, Debug, Timers, CurState, {return, _AnyRet})
end
end.

Loading…
取消
儲存