I'm not happy about the changes to FunctionDispatcher. You're comparing the thread that calls __call__ with the thread that calls __init__. What you should be doing (I think) is comparing the thread that calls __call__ with the gui thread, as q.put(res) is called in the GUI thread. Use the is_gui_thread() function to do that.
|