diff options
| author | Matthias Radestock <matthias@rabbitmq.com> | 2010-11-06 09:47:23 +0000 |
|---|---|---|
| committer | Matthias Radestock <matthias@rabbitmq.com> | 2010-11-06 09:47:23 +0000 |
| commit | 21c9ea0f509c0039ba62c6732cacb5d7bdc34261 (patch) | |
| tree | 0dc5c7673cfffa529881b89c9fbeb64f0039db0a /src | |
| parent | 6e0c2971c7c1a30fef0bc895adc79d437c99c733 (diff) | |
| download | rabbitmq-server-git-21c9ea0f509c0039ba62c6732cacb5d7bdc34261.tar.gz | |
backport upstream change to way print_event/3 is called
The code previously relied on the ancient {ModuleName,FunName} syntax
to denote functions. That is bad for dialyzer and also forces an
unnecessary export.
The underlying code in sys:handle_debug hasn't actually changed - I've
checked back as far as R12B-3 and it's always been invoking the fun
with Fun(...) and is not doing any pattern matching on it. Also, the
R12B-3 docs says that the fun is "fun(FuncState,Event,ProcState) ->
done | NewFuncState", i.e. there is no hint that it should be passed
as a {ModuleName,FunName} pair.
Diffstat (limited to 'src')
| -rw-r--r-- | src/gen_server2.erl | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gen_server2.erl b/src/gen_server2.erl index 230d1f2aa1..85a9852560 100644 --- a/src/gen_server2.erl +++ b/src/gen_server2.erl @@ -177,7 +177,7 @@ format_status/2]). %% Internal exports --export([init_it/6, print_event/3]). +-export([init_it/6]). -import(error_logger, [format/2]). @@ -612,7 +612,7 @@ process_msg(Msg, _Msg when Debug =:= [] -> handle_msg(Msg, GS2State); _Msg -> - Debug1 = sys:handle_debug(Debug, {?MODULE, print_event}, + Debug1 = sys:handle_debug(Debug, fun print_event/3, Name, {in, Msg}), handle_msg(Msg, GS2State #gs2_state { debug = Debug1 }) end. @@ -838,13 +838,13 @@ handle_msg({'$gen_call', From, Msg}, GS2State = #gs2_state { mod = Mod, time = Time1, debug = Debug1}); {noreply, NState} -> - Debug1 = common_debug(Debug, {?MODULE, print_event}, Name, + Debug1 = common_debug(Debug, fun print_event/3, Name, {noreply, NState}), loop(GS2State #gs2_state {state = NState, time = infinity, debug = Debug1}); {noreply, NState, Time1} -> - Debug1 = common_debug(Debug, {?MODULE, print_event}, Name, + Debug1 = common_debug(Debug, fun print_event/3, Name, {noreply, NState}), loop(GS2State #gs2_state {state = NState, time = Time1, @@ -866,13 +866,13 @@ handle_common_reply(Reply, Msg, GS2State = #gs2_state { name = Name, debug = Debug}) -> case Reply of {noreply, NState} -> - Debug1 = common_debug(Debug, {?MODULE, print_event}, Name, + Debug1 = common_debug(Debug, fun print_event/3, Name, {noreply, NState}), loop(GS2State #gs2_state { state = NState, time = infinity, debug = Debug1 }); {noreply, NState, Time1} -> - Debug1 = common_debug(Debug, {?MODULE, print_event}, Name, + Debug1 = common_debug(Debug, fun print_event/3, Name, {noreply, NState}), loop(GS2State #gs2_state { state = NState, time = Time1, @@ -894,7 +894,7 @@ handle_common_termination(Reply, Msg, GS2State) -> reply(Name, {To, Tag}, Reply, State, Debug) -> reply({To, Tag}, Reply), sys:handle_debug( - Debug, {?MODULE, print_event}, Name, {out, Reply, To, State}). + Debug, fun print_event/3, Name, {out, Reply, To, State}). %%----------------------------------------------------------------- |
