From c532504d17fcedf8fbaad3017635fc4a3ca32fc5 Mon Sep 17 00:00:00 2001 From: "szager@chromium.org" Date: Sat, 23 Aug 2014 02:35:23 +0000 Subject: [PATCH] Fix thread lock around cachepath access. R=cmp@chromium.org, agable@chromium.org BUG= Review URL: https://codereview.chromium.org/468253003 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@291571 0039d316-1c4b-4281-b951-d872f2087c98 --- git_cache.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/git_cache.py b/git_cache.py index 1ac9a41c23..d6ed2a82d3 100755 --- a/git_cache.py +++ b/git_cache.py @@ -200,7 +200,9 @@ class Mirror(object): @classmethod def SetCachePath(cls, cachepath): + cls.cachepath_lock.acquire() setattr(cls, 'cachepath', cachepath) + cls.cachepath_lock.release() @classmethod def GetCachePath(cls): @@ -215,7 +217,7 @@ class Mirror(object): cls.cachepath_lock.release() raise RuntimeError('No global cache.cachepath git configuration found.') setattr(cls, 'cachepath', cachepath) - cls.cachepath_lock.release() + cls.cachepath_lock.release() return getattr(cls, 'cachepath') def RunGit(self, cmd, **kwargs):