diff options
author | Hans Bolinder <[email protected]> | 2014-03-12 09:17:17 +0100 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2014-03-20 16:00:26 +0100 |
commit | ce20094582493203c8812cd003e3d3b080f88607 (patch) | |
tree | 355a2fed2076173cde6ab1394542f67e17ba8a8a /lib/kernel/src/global.erl | |
parent | 73af231f1a22083031df49ba19fdfd4f6b434a10 (diff) | |
download | otp-ce20094582493203c8812cd003e3d3b080f88607.tar.gz otp-ce20094582493203c8812cd003e3d3b080f88607.tar.bz2 otp-ce20094582493203c8812cd003e3d3b080f88607.zip |
Fix some Dialyzer warnings
Dialyzer recognizes a certain pattern that makes it possible to get
rid of 'The created fun has no local return' warnings.
Diffstat (limited to 'lib/kernel/src/global.erl')
-rw-r--r-- | lib/kernel/src/global.erl | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/lib/kernel/src/global.erl b/lib/kernel/src/global.erl index ef878b8d0c..0a4edea452 100644 --- a/lib/kernel/src/global.erl +++ b/lib/kernel/src/global.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 @@ -1513,14 +1513,18 @@ delete_global_name(_Name, _Pid) -> -record(him, {node, locker, vsn, my_tag}). start_the_locker(DoTrace) -> - spawn_link(fun() -> init_the_locker(DoTrace) end). - -init_the_locker(DoTrace) -> - process_flag(trap_exit, true), % needed? - S0 = #multi{do_trace = DoTrace}, - S1 = update_locker_known({add, get_known()}, S0), - loop_the_locker(S1), - erlang:error(locker_exited). + spawn_link(init_the_locker_fun(DoTrace)). + +-spec init_the_locker_fun(boolean()) -> fun(() -> no_return()). + +init_the_locker_fun(DoTrace) -> + fun() -> + process_flag(trap_exit, true), % needed? + S0 = #multi{do_trace = DoTrace}, + S1 = update_locker_known({add, get_known()}, S0), + loop_the_locker(S1), + erlang:error(locker_exited) + end. loop_the_locker(S) -> ?trace({loop_the_locker,S}), |