2010-09-21 20:44:57 |
Tony Byrne |
description |
Binary package hint: quickly-widgets
To demonstrate bug add print current thread commands to some params["kill"] writes, patch included here.
--- asynch_task_progressbox.py
+++ asynch_task_progressbox_debug.py
@@ -210,6 +210,7 @@
#set up params and include the kill flag
if self.params == None:
self.params = {}
+ print 'set kill false:', threading.currentThread()
self.params["kill"] = False
#tell the function to run
data = self.run_function(self.params)
@@ -219,6 +220,7 @@
#Tell the user's function that it should stop
#Note the user's function may not check this
def kill( self ):
+ print 'set kill true:', threading.currentThread()
self.params["kill"] = True
class TestWindow(gtk.Window):
Click cancel button while asynch_task_progressbox.py is running.
Output shown indicates 2 threads writing to params
set kill false: <KillableThread(Thread-1, started -1219007632)>
starting...
100
set kill true: <_MainThread(MainThread, started -1216506176)>
cancel requested
returned stopped at 101
set kill true: <KillableThread(Thread-1, started -1219007632)>
Affects version 10.09 |
Binary package hint: quickly-widgets
Variable params is shared between main and killable threads, this can cause unexpected intereaction between these threads. Comment #1 contains fix. |
|