[jToolkit-cvs] jToolkit/widgets chart.py,1.8,1.9
Brought to you by:
davidfraser,
friedelwolff
From: <dav...@us...> - 2004-02-10 08:33:05
|
Update of /cvsroot/jtoolkit/jToolkit/widgets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18831 Modified Files: chart.py Log Message: Added lock to make gdchart usage thread-safe Index: chart.py =================================================================== RCS file: /cvsroot/jtoolkit/jToolkit/widgets/chart.py,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** chart.py 10 Feb 2004 08:27:40 -0000 1.8 --- chart.py 10 Feb 2004 08:29:40 -0000 1.9 *************** *** 13,16 **** --- 13,20 ---- gdchart.defaults = gdchart.option() + #We need this lock for gdchart, as it's not thread-safe + from threading import Lock + gdchartLock = Lock() + # This class is just a container for option values. class Chart(widgets.PlainContents): *************** *** 43,49 **** --- 47,55 ---- def gethtml(self): + gdchartLock.acquire() self.draw() tempfile = cStringIO.StringIO() gdchart.chart(self.chartType, self.chartSize, tempfile, self.xdata, *self.ydata) + gdchartLock.release() return tempfile.getvalue() |