[Piglit] [PATCH 7/7] Respond to KeyboardInterrupt exception.

U. Artie Eoff ullysses.a.eoff at intel.com
Mon Feb 7 18:55:01 PST 2011


Respond to KeyboardInterrupt exception so that execution can
clean up and write a summary file before shutting down.
---
 framework/threads.py |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/framework/threads.py b/framework/threads.py
index 0e420f2..edd7ede 100644
--- a/framework/threads.py
+++ b/framework/threads.py
@@ -71,5 +71,10 @@ class ThreadPools(Singleton):
 
 	def joinAll(self):
 		pools = list(self.threadpools.itervalues())
-		for pool in pools:
-			pool.wait()
+		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