[Piglit] [PATCH 3/4] Remove ThreadPools
U. Artie Eoff
ullysses.a.eoff at intel.com
Sat Feb 12 12:07:07 PST 2011
Remove ThreadPools from threads module since it is no longer
needed/used. ConcurrentTestPool is now the only threadpool needed
to manage cpu-only tests.
---
framework/threads.py | 38 --------------------------------------
1 files changed, 0 insertions(+), 38 deletions(-)
diff --git a/framework/threads.py b/framework/threads.py
index 2613c38..855fadf 100644
--- a/framework/threads.py
+++ b/framework/threads.py
@@ -56,41 +56,3 @@ class ConcurrentTestPool(Singleton):
def join(self):
self.pool.wait()
-
-class ThreadPools(Singleton):
- @synchronized_self
- def init(self):
- self.threadpools = dict() # {name : threadpool}
- self.create("base", 1)
-
- @synchronized_self
- def lookup(self, name):
- return self.threadpools.get(name, None)
-
- @synchronized_self
- def create(self, name, count = 2):
- if self.lookup(name) is None:
- self.threadpools[name] = ThreadPool(count)
- else:
- raise RuntimeWarning, "ThreadPool '%s' has already been created." % name
-
- @synchronized_self
- def put(self, callable_, args = None, kwds = None, name = "base"):
- pool = self.lookup(name)
- if pool is None:
- raise RuntimeError, "ThreadPool '%s' does not exist." % name
- pool.putRequest(
- WorkRequest(
- callable_, args = args, kwds = kwds
- )
- )
-
- def joinAll(self):
- pools = list(self.threadpools.itervalues())
- try:
- for pool in pools:
- pool.wait()
- except KeyboardInterrupt:
- pools = list(self.threadpools.itervalues())
- for pool in pools:
- pool.dismissWorkers(len(pool.workers))
--
1.7.3.4
More information about the Piglit
mailing list