aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer/test/race_SUITE_data/src/ets_insert_new.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dialyzer/test/race_SUITE_data/src/ets_insert_new.erl')
-rw-r--r--lib/dialyzer/test/race_SUITE_data/src/ets_insert_new.erl15
1 files changed, 15 insertions, 0 deletions
diff --git a/lib/dialyzer/test/race_SUITE_data/src/ets_insert_new.erl b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_new.erl
new file mode 100644
index 0000000000..63f3272912
--- /dev/null
+++ b/lib/dialyzer/test/race_SUITE_data/src/ets_insert_new.erl
@@ -0,0 +1,15 @@
+%% This tests the presence of possible races due to an ets:lookup/ets:insert
+%% combination. It takes into account multiple ets:new calls that might exist.
+
+-module(ets_insert_new).
+-export([test/0]).
+
+test() ->
+ T1 = ets:new(foo, [public]),
+ T2 = ets:new(bar, []),
+ ets:lookup(T2, counter),
+ aux(T1),
+ aux(T2).
+
+aux(Tab) ->
+ ets:insert(Tab, {counter, 1}).