aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/test/race_tests_SUITE_data/src/whereis_intra_inter_module4/whereis_intra_inter_module8.erl
blob: 581817308b920e67bc470e21f5cfe36a840bc7ad (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
%% This tests that the race condition detection between whereis/register
%% is robust w.r.t. having the calls in separate functions and modules.

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

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