Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:19
erlang
0900-use-ets-select-instead-of-ets-filter-in-ap...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0900-use-ets-select-instead-of-ets-filter-in-application-.patch of Package erlang
From dabdc479867c5a0d7eda6eec9a1101591824dff0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ferenc=20B=C3=B6r=C3=B6czki?= <f3c0@users.noreply.github.com> Date: Mon, 20 Apr 2020 17:10:14 +0200 Subject: [PATCH] use ets:select instead of ets:filter in application:loaded_applications/0 ets:filter dies with badarg if there is a delete, while it is walking through the table --- lib/kernel/src/application_controller.erl | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/kernel/src/application_controller.erl b/lib/kernel/src/application_controller.erl index 895911236f..b235c44d3f 100644 --- a/lib/kernel/src/application_controller.erl +++ b/lib/kernel/src/application_controller.erl @@ -268,13 +268,12 @@ which_applications(Timeout) -> gen_server:call(?AC, which_applications, Timeout). loaded_applications() -> - ets:filter(ac_tab, - fun([{{loaded, AppName}, #appl{descr = Descr, vsn = Vsn}}]) -> - {true, {AppName, Descr, Vsn}}; - (_) -> - false - end, - []). + ets:select(ac_tab, + [{ + {{loaded, '$1'}, #appl{descr = '$2', vsn = '$3', _ = '_'}}, + [], + [{{'$1', '$2', '$3'}}] + }]). %% Returns some debug info info() -> -- 2.26.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor