[LNT] r312092 - v4db: Inline close_engine into close_all_engines

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 29 19:11:37 PDT 2017


Author: matze
Date: Tue Aug 29 19:11:37 2017
New Revision: 312092

URL: http://llvm.org/viewvc/llvm-project?rev=312092&view=rev
Log:
v4db: Inline close_engine into close_all_engines

The function wasn't used otherwise.

Modified:
    lnt/trunk/lnt/server/db/v4db.py

Modified: lnt/trunk/lnt/server/db/v4db.py
URL: http://llvm.org/viewvc/llvm-project/lnt/trunk/lnt/server/db/v4db.py?rev=312092&r1=312091&r2=312092&view=diff
==============================================================================
--- lnt/trunk/lnt/server/db/v4db.py (original)
+++ lnt/trunk/lnt/server/db/v4db.py Tue Aug 29 19:11:37 2017
@@ -115,18 +115,12 @@ class V4DB(object):
             self.session.close()
 
     @staticmethod
-    def close_engine(db_path):
-        """Rip down everything about this path, so we can make it
-        new again. This is used for tests that need to make a fresh
-        in memory database."""
-        V4DB._engine[db_path].dispose()
-        V4DB._engine.pop(db_path)
-        V4DB._db_updated.remove(db_path)
-
-    @staticmethod
     def close_all_engines():
-        for key in V4DB._engine.keys():
-            V4DB.close_engine(key)
+        with V4DB._engine_lock:
+            for key, engine in V4DB._engine.items():
+                engine.dispose()
+            V4DB._engine = {}
+            V4DB._db_updated = set()
 
     def settings(self):
         """All the setting needed to recreate this instnace elsewhere."""




More information about the llvm-commits mailing list