aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/gen_event.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2014-06-11 14:29:19 +0200
committerSiri Hansen <[email protected]>2014-06-11 14:29:19 +0200
commitda42410cb15c0749ea6cf9b6196b81320d8391b6 (patch)
tree829f5cdb59cf92cdaf381564fe51885644494650 /lib/stdlib/src/gen_event.erl
parent5f2b70f205bc64be545b75db5419111aac11291d (diff)
parent154a057dcbf087deb38b13e97f0a0373e6a72f1d (diff)
downloadotp-da42410cb15c0749ea6cf9b6196b81320d8391b6.tar.gz
otp-da42410cb15c0749ea6cf9b6196b81320d8391b6.tar.bz2
otp-da42410cb15c0749ea6cf9b6196b81320d8391b6.zip
Merge branch 'siri/sync-stop-gen/OTP-11173'
* siri/sync-stop-gen/OTP-11173: Add synchronous stop function to wx_object Fix minor bugs in gen_server and gen_fsm documentation Update gen_event:stop to be synchronous Add synchronous stop functions to gen_server and gen_fsm Add synchronous stop function to proc_lib Add system message 'terminate' Remove old code from stdlib/test/sys_sp2.erl
Diffstat (limited to 'lib/stdlib/src/gen_event.erl')
-rw-r--r--lib/stdlib/src/gen_event.erl13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/stdlib/src/gen_event.erl b/lib/stdlib/src/gen_event.erl
index bb0ff46268..934b112f6f 100644
--- a/lib/stdlib/src/gen_event.erl
+++ b/lib/stdlib/src/gen_event.erl
@@ -31,8 +31,8 @@
%%% Modified by Martin - uses proc_lib, sys and gen!
--export([start/0, start/1, start_link/0, start_link/1, stop/1, notify/2,
- sync_notify/2,
+-export([start/0, start/1, start_link/0, start_link/1, stop/1, stop/3,
+ notify/2, sync_notify/2,
add_handler/3, add_sup_handler/3, delete_handler/3, swap_handler/3,
swap_sup_handler/3, which_handlers/1, call/3, call/4, wake_hib/4]).
@@ -193,7 +193,11 @@ swap_sup_handler(M, {H1, A1}, {H2, A2}) ->
which_handlers(M) -> rpc(M, which_handlers).
-spec stop(emgr_ref()) -> 'ok'.
-stop(M) -> rpc(M, stop).
+stop(M) ->
+ gen:stop(M).
+
+stop(M, Reason, Timeout) ->
+ gen:stop(M, Reason, Timeout).
rpc(M, Cmd) ->
{ok, Reply} = gen:call(M, self(), Cmd, infinity),
@@ -292,9 +296,6 @@ handle_msg(Msg, Parent, ServerName, MSL, Debug) ->
Args2, MSL, Sup, ServerName),
?reply(Reply),
loop(Parent, ServerName, MSL1, Debug, Hib);
- {From, Tag, stop} ->
- catch terminate_server(normal, Parent, MSL, ServerName),
- ?reply(ok);
{From, Tag, which_handlers} ->
?reply(the_handlers(MSL)),
loop(Parent, ServerName, MSL, Debug, false);