[Piglit] [PATCH 2/2] remove framework/threads.py
Dylan Baker
baker.dylan.c at gmail.com
Fri Dec 12 09:43:17 PST 2014
This file hasn't been used for quite some time, at least since the
atomic backend work landed.
Signed-off-by: Dylan Baker <dylanx.c.baker at intel.com>
---
framework/threads.py | 43 -------------------------------------------
1 file changed, 43 deletions(-)
delete mode 100644 framework/threads.py
diff --git a/framework/threads.py b/framework/threads.py
deleted file mode 100644
index ec7dfcc..0000000
--- a/framework/threads.py
+++ /dev/null
@@ -1,43 +0,0 @@
-#
-# Copyright (c) 2010 Intel Corporation
-#
-# Permission is hereby granted, free of charge, to any person obtaining a
-# copy of this software and associated documentation files (the "Software"),
-# to deal in the Software without restriction, including without limitation
-# the rights to use, copy, modify, merge, publish, distribute, sublicense,
-# and/or sell copies of the Software, and to permit persons to whom the
-# Software is furnished to do so, subject to the following conditions:
-#
-# The above copyright notice and this permission notice (including the next
-# paragraph) shall be included in all copies or substantial portions of the
-# Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
-# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-# IN THE SOFTWARE.
-#
-
-from weakref import WeakKeyDictionary
-from threading import RLock
-
-
-def synchronized_self(function):
- '''
- A decorator function for providing multithreaded, synchronized access
- amongst one or more functions within a class instance.
- '''
- def wrapper(self, *args, **kwargs):
- synchronized_self.locks.setdefault(self, RLock()).acquire()
- try:
- return function(self, *args, **kwargs)
- finally:
- synchronized_self.locks[self].release()
- return wrapper
-
-
-# track the locks for each instance
-synchronized_self.locks = WeakKeyDictionary()
--
2.2.0
More information about the Piglit
mailing list