blob: 7bcde321a1376ea7de1b2b5cc528584ca6150d91 (
plain) (
tree)
|
|
%% This tests the presence of possible races due to a whereis/register
%% combination in higher order functions.
-module(whereis_param).
-export([start/2]).
start(AnAtom, Fun) ->
register(AnAtom, continue(AnAtom, Fun)).
continue(AnAtom, Fun) ->
case whereis(AnAtom) of
undefined ->
Pid = spawn(Fun);
P when is_pid(P) ->
P
end.
|