aboutsummaryrefslogblamecommitdiffstats
path: root/lib/dialyzer/test/race_tests_SUITE_data/src/whereis_diff_vars_no_race.erl
blob: 16f1d91490009813a433e59f2da5e00c079ff98a (plain) (tree)
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 even when the functions are called with different variables 
%% as arguments.

-module(whereis_diff_vars_no_race).
-export([test/3]).

test(AnAtom, AnotherAtom, Pid) ->
  {aux(AnAtom, Pid), aux(AnotherAtom, Pid)}.

aux(Atom, Pid) ->
  register(Atom, Pid),
  whereis(Atom).