2010-12-20, 23:20
lzoubek Wrote:Hi, cool addon.
I've just tried it and I have threading issues. Right now plugin is in deadlock, dialog window hangs up and is waiting for some thread. Here is pastebin. What I did was browsing a few topics. It took quite long time for one of them to load, so I've stopped it. Then I tried to login which took long time too, so I've decided to close addon.
The way I have the threading working, when you cancel an action or change an action, it tells the thread to stop and then starts a new thread if you've started some other action. When the old thread finishes any current blocking activities it will then see that it is stopped and not continue. I do this in this way because I cannot stop a blocking operation (such as opening a URL) and cannot kill the thread from the main thread. Normally this is not a problem except that if the site is down or some such thing then the thread will keep waiting for the open to finish. Then, when exiting the script I have to wait for any running threads to finish before it closes or else it will crash XBMC.
Hope that made sense
One thing I could do is make the timeout shorter, or configurable.
If anyone can tell me a way to kill a thread from the main thread that would be great. I found one way, but it required modules not available in XBMC.