Comment 0 for bug 643963

Revision history for this message
Tony Byrne (tony-badwolf) wrote : asynch_task_progressbox.py : params["kill"] written from different threads

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