Activity log for bug #643963

Date Who What changed Old value New value Message
2010-09-20 23:19:05 Tony Byrne bug added bug
2010-09-21 20:34:08 Tony Byrne summary asynch_task_progressbox.py : params["kill"] written from different threads asynch_task_progressbox.py : params shared between threads
2010-09-21 20:41:36 Tony Byrne attachment added Use copy.deepcopy to uncouple threads. https://bugs.launchpad.net/ubuntu/+source/quickly-widgets/+bug/643963/+attachment/1619973/+files/asynch_task_progressbox.py
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.
2010-09-21 20:46:16 Tony Byrne attachment added This file shows interaction between threads. https://bugs.launchpad.net/ubuntu/+source/quickly-widgets/+bug/643963/+attachment/1619983/+files/asynch_task_progressbox_shows_bug.py
2010-09-21 20:47:50 Tony Byrne attachment added This file demonstrates how fix uncouples threads. https://bugs.launchpad.net/ubuntu/+source/quickly-widgets/+bug/643963/+attachment/1619984/+files/asynch_task_progressbox_fixed.py