diff options
author | Rickard Green <[email protected]> | 2010-12-17 10:39:37 +0100 |
---|---|---|
committer | Rickard Green <[email protected]> | 2010-12-17 10:39:37 +0100 |
commit | f4f3beb158352b23959c09f8b0dfc83013d5fdf2 (patch) | |
tree | 6684443f968a9442d26afb6346e992466fc07c11 /lib/stdlib | |
parent | 3e219dd7c05762fae05815db2813e765fd3b3a8f (diff) | |
parent | 8b18824e2b13e60fb1a067f80dbb228172f6a3d2 (diff) | |
download | otp-f4f3beb158352b23959c09f8b0dfc83013d5fdf2.tar.gz otp-f4f3beb158352b23959c09f8b0dfc83013d5fdf2.tar.bz2 otp-f4f3beb158352b23959c09f8b0dfc83013d5fdf2.zip |
Merge branch 'rickard/ets-tab-delete/OTP-8999' into dev
* rickard/ets-tab-delete/OTP-8999:
Safe deallocation of ETS-table structures
Fix rwlock resource leak when hitting system limit
Conflicts:
erts/emulator/beam/erl_process.h
erts/emulator/beam/erl_process.c
Diffstat (limited to 'lib/stdlib')
-rw-r--r-- | lib/stdlib/test/ets_SUITE.erl | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/stdlib/test/ets_SUITE.erl b/lib/stdlib/test/ets_SUITE.erl index 620848003c..4e789790f6 100644 --- a/lib/stdlib/test/ets_SUITE.erl +++ b/lib/stdlib/test/ets_SUITE.erl @@ -5325,7 +5325,25 @@ my_tab_to_list(_Ts,'$end_of_table', Acc) -> lists:reverse(Acc); my_tab_to_list(Ts,Key, Acc) -> my_tab_to_list(Ts,ets:next(Ts,Key),[ets:lookup(Ts, Key)| Acc]). +wait_for_all_schedulers_online_to_execute() -> + PMs = lists:map(fun (Sched) -> + spawn_opt(fun () -> ok end, + [monitor, {scheduler, Sched}]) + end, + lists:seq(1,erlang:system_info(schedulers_online))), + lists:foreach(fun ({P, M}) -> + receive + {'DOWN', M, process, P, _} -> ok + end + end, + PMs), + ok. + etsmem() -> + %% Wait until it is guaranteed that all already scheduled + %% deallocations of DbTable structures have completed. + wait_for_all_schedulers_online_to_execute(), + AllTabs = lists:map(fun(T) -> {T,ets:info(T,name),ets:info(T,size), ets:info(T,memory),ets:info(T,type)} end, ets:all()), |