aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/test/race_SUITE_data/src/whereis_param_inter_module/whereis_param_inter_module2.erl
blob: 61252add9aa1865b8b875d33e61b8ed5fd379799 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
%% This tests the presence of possible races due to a whereis/register
%% combination in higher order functions and inter-module calls.

-module(whereis_param_inter_module2).
-export([continue/2]).

continue(AnAtom, Fun) ->
  case whereis(AnAtom) of
    undefined ->
      Pid = spawn(Fun);
    P when is_pid(P) ->
      P
  end.