aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/gen_server.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2014-04-30 09:35:06 +0200
committerSiri Hansen <[email protected]>2014-05-26 11:53:25 +0200
commit9d7d1207ff1240b9711f192deb0893c3a044a3d8 (patch)
tree037f076b22551563cd4bcd759d71725514ce5f4b /lib/stdlib/src/gen_server.erl
parent9a0635c297503e2ce0ae394c9c44c72fc61a2a31 (diff)
downloadotp-9d7d1207ff1240b9711f192deb0893c3a044a3d8.tar.gz
otp-9d7d1207ff1240b9711f192deb0893c3a044a3d8.tar.bz2
otp-9d7d1207ff1240b9711f192deb0893c3a044a3d8.zip
Add synchronous stop functions to gen_server and gen_fsm
The functions utilize proc_lib:stop, which in turn utilizes sys:terminate.
Diffstat (limited to 'lib/stdlib/src/gen_server.erl')
-rw-r--r--lib/stdlib/src/gen_server.erl12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/stdlib/src/gen_server.erl b/lib/stdlib/src/gen_server.erl
index 22acdf10b7..9794c73cc2 100644
--- a/lib/stdlib/src/gen_server.erl
+++ b/lib/stdlib/src/gen_server.erl
@@ -88,6 +88,7 @@
%% API
-export([start/3, start/4,
start_link/3, start_link/4,
+ stop/1, stop/3,
call/2, call/3,
cast/2, reply/2,
abcast/2, abcast/3,
@@ -177,6 +178,17 @@ start_link(Name, Mod, Args, Options) ->
%% -----------------------------------------------------------------
+%% Stop a generic server and wait for it to terminate.
+%% If the server is located at another node, that node will
+%% be monitored.
+%% -----------------------------------------------------------------
+stop(Name) ->
+ gen:stop(Name).
+
+stop(Name, Reason, Timeout) ->
+ gen:stop(Name, Reason, Timeout).
+
+%% -----------------------------------------------------------------
%% Make a call to a generic server.
%% If the server is located at another node, that node will
%% be monitored.