aboutsummaryrefslogtreecommitdiffstats
path: root/lib/stdlib
diff options
context:
space:
mode:
authorHans Bolinder <[email protected]>2013-03-12 16:22:00 +0100
committerHans Bolinder <[email protected]>2013-03-12 16:22:00 +0100
commit003c9b55b987b3d0e650b84201bb08e729ed0a9a (patch)
tree165b45e39eaa248631a89a0e7f095ba42b9460a8 /lib/stdlib
parent7ceea5941c3bb583b8a17c477edafbce01b841ee (diff)
parent6e445498dfa736090f3080484204b65a1ca25703 (diff)
downloadotp-003c9b55b987b3d0e650b84201bb08e729ed0a9a.tar.gz
otp-003c9b55b987b3d0e650b84201bb08e729ed0a9a.tar.bz2
otp-003c9b55b987b3d0e650b84201bb08e729ed0a9a.zip
Merge branch 'maint'
* maint: [debugger] Add an option 'Strings' stdlib: Remove race in ets_SUITE:delete_large_tab stdlib: Remove race in ets_SUITE:delete_large_named_table
Diffstat (limited to 'lib/stdlib')
-rw-r--r--lib/stdlib/test/ets_SUITE.erl20
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/stdlib/test/ets_SUITE.erl b/lib/stdlib/test/ets_SUITE.erl
index b6c94a6f6d..d40609eeb0 100644
--- a/lib/stdlib/test/ets_SUITE.erl
+++ b/lib/stdlib/test/ets_SUITE.erl
@@ -3218,6 +3218,7 @@ delete_large_tab_1(Name, Flags, Data, Fix) ->
end
end,
0),
+ SchedTracerMon = monitor(process, SchedTracer),
?line Loopers = start_loopers(erlang:system_info(schedulers),
Prio,
fun (_) -> erlang:yield() end,
@@ -3237,12 +3238,14 @@ delete_large_tab_1(Name, Flags, Data, Fix) ->
N >= 5 -> ?line ok;
true -> ?line ?t:fail()
end
- end.
+ end,
+ receive {'DOWN',SchedTracerMon,process,SchedTracer,_} -> ok end,
+ ok.
delete_large_named_table(doc) ->
"Delete a large name table and try to create a new table with the same name in another process.";
delete_large_named_table(Config) when is_list(Config) ->
- ?line Data = [{erlang:phash2(I, 16#ffffff),I} || I <- lists:seq(1, 500000)],
+ ?line Data = [{erlang:phash2(I, 16#ffffff),I} || I <- lists:seq(1, 200000)],
?line EtsMem = etsmem(),
repeat_for_opts(fun(Opts) -> delete_large_named_table_do(Opts,Data) end),
?line verify_etsmem(EtsMem),
@@ -3264,16 +3267,17 @@ delete_large_named_table_1(Name, Flags, Data, Fix) ->
?line lists:foreach(fun({K,_}) -> ets:delete(Tab, K) end, Data)
end,
Parent = self(),
- Pid = my_spawn_link(fun() ->
- receive
- {trace,Parent,call,_} ->
- ets_new(Name, [named_table])
- end
- end),
+ {Pid, MRef} = my_spawn_opt(fun() ->
+ receive
+ {trace,Parent,call,_} ->
+ ets_new(Name, [named_table])
+ end
+ end, [link, monitor]),
?line erlang:trace(self(), true, [call,{tracer,Pid}]),
?line erlang:trace_pattern({ets,delete,1}, true, [global]),
?line erlang:yield(), true = ets:delete(Tab),
?line erlang:trace_pattern({ets,delete,1}, false, [global]),
+ receive {'DOWN',MRef,process,Pid,_} -> ok end,
ok.
evil_delete(doc) ->