blob: 8de9cb2dadfacd690f4fe430c729f701de13b0ed (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
|
%% This tests the presence of possible races due to a whereis/unregister
%% combination. It takes into account control flow that might exist.
-module(whereis_control_flow5).
-export([start/1]).
start(AnAtom) ->
case whereis(AnAtom) of
undefined -> ok;
P when is_pid(P) ->
unregister(AnAtom)
end.
|