summaryrefslogtreecommitdiff
path: root/lib/stdlib/src/gen_server.erl
diff options
context:
space:
mode:
authorFredrik Gustafsson <fredrik@erlang.org>2013-04-04 14:38:00 +0200
committerFredrik Gustafsson <fredrik@erlang.org>2013-04-04 14:38:00 +0200
commite72043e3519cb14aabf461849eba959b97e07410 (patch)
tree4dd3d5fc301fef9acc620ba73205ea9fb7881acc /lib/stdlib/src/gen_server.erl
parentbad78f7daf7299603ea807c90839450a5f1307ce (diff)
parent709823671313793a6e29abfde4cbb548348910c2 (diff)
downloaderlang-e72043e3519cb14aabf461849eba959b97e07410.tar.gz
Merge branch 'sv/stdlib/sys-get-state/OTP-11013' into maint
* sv/stdlib/sys-get-state/OTP-11013: Removed ?line macro add sys:get_state/1,2 and sys:replace_state/2,3 update sys:get_status/2,3 documentation for gen_event
Diffstat (limited to 'lib/stdlib/src/gen_server.erl')
-rw-r--r--lib/stdlib/src/gen_server.erl7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/stdlib/src/gen_server.erl b/lib/stdlib/src/gen_server.erl
index 04308a51b7..9c4b95acf6 100644
--- a/lib/stdlib/src/gen_server.erl
+++ b/lib/stdlib/src/gen_server.erl
@@ -372,6 +372,13 @@ wake_hib(Parent, Name, State, Mod, Debug) ->
decode_msg(Msg, Parent, Name, State, Mod, Time, Debug, Hib) ->
case Msg of
+ {system, From, get_state} ->
+ sys:handle_system_msg(get_state, From, Parent, ?MODULE, Debug,
+ {State, [Name, State, Mod, Time]}, Hib);
+ {system, From, {replace_state, StateFun}} ->
+ NState = try StateFun(State) catch _:_ -> State end,
+ sys:handle_system_msg(replace_state, From, Parent, ?MODULE, Debug,
+ {NState, [Name, NState, Mod, Time]}, Hib);
{system, From, Req} ->
sys:handle_system_msg(Req, From, Parent, ?MODULE, Debug,
[Name, State, Mod, Time], Hib);