1
%% This tests the presence of possible races due to an ets:lookup/ets:insert
2
%% combination. It takes into account the anonymous functions.
4
-module(ets_insert_funs1).
11
io:format("Created ~w\n", [ets:new(foo, [named_table, public])]),
12
ets:insert(foo, {counter, 0}),
13
io:format("Inserted ~w\n", [{counter, 0}]),
15
ets:insert(foo, [{counter, N+1}]),
16
io:format("Update complete\n", []),
17
ObjectList = ets:lookup(foo, counter),
18
io:format("Counter: ~w\n", [ObjectList]).