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

Unified Diff: build/android/devil/utils/lazy/weak_constant.py

Issue 1770943003: [Android] Remove chromium version of devil. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 9 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 | « build/android/devil/utils/lazy/__init__.py ('k') | build/android/devil/utils/lsusb.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/devil/utils/lazy/weak_constant.py
diff --git a/build/android/devil/utils/lazy/weak_constant.py b/build/android/devil/utils/lazy/weak_constant.py
deleted file mode 100644
index 3558f29ac6722dda01fb6c5892653cd96446f7f0..0000000000000000000000000000000000000000
--- a/build/android/devil/utils/lazy/weak_constant.py
+++ /dev/null
@@ -1,29 +0,0 @@
-# Copyright 2015 The Chromium Authors. All rights reserved.
-# Use of this source code is governed by a BSD-style license that can be
-# found in the LICENSE file.
-
-import threading
-
-
-class WeakConstant(object):
- """A thread-safe, lazily initialized object.
-
- This does not support modification after initialization. The intended
- constant nature of the object is not enforced, though, hence the "weak".
- """
-
- def __init__(self, initializer):
- self._initialized = False
- self._initializer = initializer
- self._lock = threading.Lock()
- self._val = None
-
- def read(self):
- """Get the object, creating it if necessary."""
- if self._initialized:
- return self._val
- with self._lock:
- if not self._initialized:
- self._val = self._initializer()
- self._initialized = True
- return self._val
« no previous file with comments | « build/android/devil/utils/lazy/__init__.py ('k') | build/android/devil/utils/lsusb.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698