1
%% This tests that the race condition detection between ets:lookup/
2
%% ets:insert is robust even when the functions are called with
3
%% different atoms as arguments.
5
-module(ets_insert_diff_atoms_race5).
9
ets:new(foo, [named_table, public]),
10
{race(foo, counter), no_race(foo, counter)}.
13
[{_, N}] = ets:lookup(Tab, Counter),
16
no_race(Tab, Counter) ->
17
[{_, N}] = ets:lookup(Tab, Counter),
18
AnotherCounter = index,
19
aux(Tab, AnotherCounter, N).
21
aux(Table, Counter, N) ->
22
ets:insert(Table, [{Counter, N+1}]).