[Piglit] [PATCH 3/7] Add synchronization to Logger functions.

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


Add synchronization decorator to Logger functions for multithreaded
logging support.
---
 framework/log.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/framework/log.py b/framework/log.py
index c3fbdd7..e90137a 100644
--- a/framework/log.py
+++ b/framework/log.py
@@ -21,13 +21,16 @@
 # IN THE SOFTWARE.
 #
 
+from threads import synchronized_self
 from patterns import Singleton
 import logging
 
 class Logger(Singleton):
+	@synchronized_self
 	def __logMessage(self, logfunc, message, **kwargs):
 		[logfunc(line, **kwargs) for line in message.split('\n')]
 
+	@synchronized_self
 	def getLogger(self, channel = None):
 		if 0 == len(logging.root.handlers):
 			logging.basicConfig(
-- 
1.7.3.4



More information about the Piglit mailing list