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

Unified Diff: gclient_utils.py

Issue 3338017: Enter a description of the change. (Closed)
Patch Set: Created 10 years, 3 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 9d14bd2554889e0d9bce345657990bca19b22b01..122e81a21adaa5a6194e9ed60dcf3ee2bfb4f3f7 100644
--- a/gclient_utils.py
+++ b/gclient_utils.py
@@ -298,10 +298,13 @@ class StdoutAutoFlush(object):
"""Thread-safe."""
self.stdout.write(out)
should_flush = False
- with self.lock:
+ self.lock.acquire()
+ try:
if (time.time() - self.last_flushed_at) > self.delay:
should_flush = True
self.last_flushed_at = time.time()
+ finally:
+ self.lock.release()
if should_flush:
self.stdout.flush()
« 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