diff options
author | Fredrik Gustafsson <[email protected]> | 2013-04-04 14:38:00 +0200 |
---|---|---|
committer | Fredrik Gustafsson <[email protected]> | 2013-04-04 14:38:00 +0200 |
commit | e72043e3519cb14aabf461849eba959b97e07410 (patch) | |
tree | 4dd3d5fc301fef9acc620ba73205ea9fb7881acc /lib/stdlib/src/gen_server.erl | |
parent | bad78f7daf7299603ea807c90839450a5f1307ce (diff) | |
parent | 709823671313793a6e29abfde4cbb548348910c2 (diff) | |
download | otp-e72043e3519cb14aabf461849eba959b97e07410.tar.gz otp-e72043e3519cb14aabf461849eba959b97e07410.tar.bz2 otp-e72043e3519cb14aabf461849eba959b97e07410.zip |
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.erl | 7 |
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); |