Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(372)

Unified Diff: gclient_utils.py

Issue 8253008: Work around lock failure on cygwin. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Address review comments Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gclient_utils.py
diff --git a/gclient_utils.py b/gclient_utils.py
index 235d414585835785db978f3d3ffe88b1e11c2eca..39fb2f660345342aefc1ea961f3003199ff3bb06 100644
--- a/gclient_utils.py
+++ b/gclient_utils.py
@@ -481,7 +481,14 @@ class WorkItem(object):
def __init__(self, name):
# A unique string representing this work item.
self._name = name
- self.lock = threading.RLock()
+ try:
+ self.lock = threading.Lock()
+ except: # pylint: disable=W0702
+ if sys.platform != 'cygwin':
+ raise
+ # On cygwin, it's throwing randomly. Hack and reuse the single
+ # sys.stdout.lock. Yep you read it right. Single lock.
+ self.lock = sys.stdout.lock
def run(self, work_queue):
"""work_queue is passed as keyword argument so it should be
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698