diff options
author | Hans Bolinder <[email protected]> | 2011-11-14 13:49:35 +0100 |
---|---|---|
committer | Hans Bolinder <[email protected]> | 2011-11-14 14:10:58 +0100 |
commit | 4db61fcf79516ff9cd6fd04c89376f063ccae7e8 (patch) | |
tree | 77ad0bbadc2096664d649f7896fe9a0882b39192 /lib/stdlib/src/gen_fsm.erl | |
parent | feb6c1dece891c7cb46c24bbdf9082c758c7830e (diff) | |
download | otp-4db61fcf79516ff9cd6fd04c89376f063ccae7e8.tar.gz otp-4db61fcf79516ff9cd6fd04c89376f063ccae7e8.tar.bz2 otp-4db61fcf79516ff9cd6fd04c89376f063ccae7e8.zip |
Remove all use of global:safe_whereis_name/1
Calls to global:whereis_name/1 have been substituted for calls to
global:safe_whereis_name/1 since the latter is not safe at all.
The reason for not doing this earlier is that setting a global lock
masked out a bug concerning the restart of supervised children. The
bug has now been fixed by a modification of global:whereis_name/1.
(Thanks to Ulf Wiger for code contribution.)
Diffstat (limited to 'lib/stdlib/src/gen_fsm.erl')
-rw-r--r-- | lib/stdlib/src/gen_fsm.erl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/stdlib/src/gen_fsm.erl b/lib/stdlib/src/gen_fsm.erl index 6bfb72421b..57734a075c 100644 --- a/lib/stdlib/src/gen_fsm.erl +++ b/lib/stdlib/src/gen_fsm.erl @@ -296,7 +296,7 @@ get_proc_name({local, Name}) -> exit(process_not_registered) end; get_proc_name({global, Name}) -> - case global:safe_whereis_name(Name) of + case global:whereis_name(Name) of undefined -> exit(process_not_registered_globally); Pid when Pid =:= self() -> @@ -318,7 +318,7 @@ get_parent() -> name_to_pid(Name) -> case whereis(Name) of undefined -> - case global:safe_whereis_name(Name) of + case global:whereis_name(Name) of undefined -> exit(could_not_find_registerd_name); Pid -> |