aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/test/sys_SUITE.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2014-05-07 11:17:24 +0200
committerSiri Hansen <[email protected]>2014-05-26 11:53:25 +0200
commit6c3d24ccbc597e6d31db1f559470cc59585fdf52 (patch)
tree8509ed16e8f241b63dc0a5c9d202eb72d325bf4f /lib/stdlib/test/sys_SUITE.erl
parentaa0caafe360cce6afd91739a019ec1f8b3478424 (diff)
downloadotp-6c3d24ccbc597e6d31db1f559470cc59585fdf52.tar.gz
otp-6c3d24ccbc597e6d31db1f559470cc59585fdf52.tar.bz2
otp-6c3d24ccbc597e6d31db1f559470cc59585fdf52.zip
Add system message 'terminate'
This is to be used when implementing synchronous stop of generic behaviours and other 'sys special processes'.
Diffstat (limited to 'lib/stdlib/test/sys_SUITE.erl')
-rw-r--r--lib/stdlib/test/sys_SUITE.erl16
1 files changed, 4 insertions, 12 deletions
diff --git a/lib/stdlib/test/sys_SUITE.erl b/lib/stdlib/test/sys_SUITE.erl
index f38bc87ae5..047ee9f1fa 100644
--- a/lib/stdlib/test/sys_SUITE.erl
+++ b/lib/stdlib/test/sys_SUITE.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2013. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
%%
%% The contents of this file are subject to the Erlang Public License,
%% Version 1.1, (the "License"); you may not use this file except in
@@ -202,14 +202,7 @@ spec_proc(Mod) ->
{Mod,system_get_state},{throw,fail}},_}} ->
ok
end,
- Mod:stop(),
- WaitForUnregister = fun W() ->
- case whereis(Mod) of
- undefined -> ok;
- _ -> timer:sleep(10), W()
- end
- end,
- WaitForUnregister(),
+ ok = sys:terminate(Mod, normal),
{ok,_} = Mod:start_link(4),
ok = case catch sys:replace_state(Mod, fun(_) -> {} end) of
{} ->
@@ -218,8 +211,7 @@ spec_proc(Mod) ->
{Mod,system_replace_state},{throw,fail}},_}} ->
ok
end,
- Mod:stop(),
- WaitForUnregister(),
+ ok = sys:terminate(Mod, normal),
{ok,_} = Mod:start_link(4),
StateFun = fun(_) -> error(fail) end,
ok = case catch sys:replace_state(Mod, StateFun) of
@@ -231,7 +223,7 @@ spec_proc(Mod) ->
{'EXIT',{{callback_failed,StateFun,{error,fail}},_}} ->
ok
end,
- Mod:stop().
+ ok = sys:terminate(Mod, normal).
%%%%%%%%%%%%%%%%%%%%
%% Dummy server