aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib/src/gen_event.erl
diff options
context:
space:
mode:
authorRaimo Niskanen <[email protected]>2015-10-26 11:50:43 +0100
committerRaimo Niskanen <[email protected]>2015-12-15 15:29:53 +0100
commitadcc726c36555434204dd0fccd13ed984741a7fb (patch)
tree7b1c9922d8ca4d460f32f05e067ef7114e70fb74 /lib/stdlib/src/gen_event.erl
parentb855206a1a7788216717ca272f44e9beb1f58e7c (diff)
downloadotp-adcc726c36555434204dd0fccd13ed984741a7fb.tar.gz
otp-adcc726c36555434204dd0fccd13ed984741a7fb.tar.bz2
otp-adcc726c36555434204dd0fccd13ed984741a7fb.zip
Factor out common code to gen.erl
Diffstat (limited to 'lib/stdlib/src/gen_event.erl')
-rw-r--r--lib/stdlib/src/gen_event.erl11
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/stdlib/src/gen_event.erl b/lib/stdlib/src/gen_event.erl
index 3d63c19de7..aedc0e7c59 100644
--- a/lib/stdlib/src/gen_event.erl
+++ b/lib/stdlib/src/gen_event.erl
@@ -1,7 +1,7 @@
%%
%% %CopyrightBegin%
%%
-%% Copyright Ericsson AB 1996-2014. All Rights Reserved.
+%% Copyright Ericsson AB 1996-2015. All Rights Reserved.
%%
%% Licensed under the Apache License, Version 2.0 (the "License");
%% you may not use this file except in compliance with the License.
@@ -147,16 +147,11 @@ init_it(Starter, self, Name, Mod, Args, Options) ->
init_it(Starter, self(), Name, Mod, Args, Options);
init_it(Starter, Parent, Name0, _, _, Options) ->
process_flag(trap_exit, true),
- Debug = gen:debug_options(Options),
+ Name = gen:name(Name0),
+ Debug = gen:debug_options(Name, Options),
proc_lib:init_ack(Starter, {ok, self()}),
- Name = name(Name0),
loop(Parent, Name, [], Debug, false).
-name({local,Name}) -> Name;
-name({global,Name}) -> Name;
-name({via,_, Name}) -> Name;
-name(Pid) when is_pid(Pid) -> Pid.
-
-spec add_handler(emgr_ref(), handler(), term()) -> term().
add_handler(M, Handler, Args) -> rpc(M, {add_handler, Handler, Args}).