diff options
author | U. Artie Eoff <ullysses.a.eoff@intel.com> | 2011-02-12 12:07:07 -0800 |
---|---|---|
committer | Chad Versace <chad.versace@intel.com> | 2011-02-17 08:08:42 -0800 |
commit | bc66671c2860145092a70eb9fec0d3114d8edfaf (patch) | |
tree | 6d9d6fa4ba49bf840cdad54a984e315be844045a /framework | |
parent | 7b95d521bea9cb4f81e1d7b014fb14ef43864af6 (diff) |
Remove ThreadPools
Remove ThreadPools from threads module since it is no longer
needed/used. ConcurrentTestPool is now the only threadpool needed
to manage cpu-only tests.
Reviewed-by: Chad Versace <chad.versace@intel.com>
Diffstat (limited to 'framework')
-rw-r--r-- | framework/threads.py | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/framework/threads.py b/framework/threads.py index 2613c38b..855fadf8 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)) |