Hi Marcus,
I get the errors when a function is called from within my queue, which operates its own (single) thread. The function goes awry when it tries to call the instances' private (or public, or superclass) member variables. In my case it tries to up a counter (_cnt++). There is no external interferance with these variables.
What is strange in my opinion, but I could be totally wrong of course :), is that the function is correctly executed, as long as I do not call instance/class variables. It seems as if an class instance can be broken down while a function of that class is still active or that an instance is garbage collected in parts. What's the difference between a class function and class member when it comes down to garbage collecting?
In another case, I solved the problem by first copying, upon function entry, the required class member into a local member and all is fine.
Again, if I'm just asking something stoopid; just tell me :)
On 3/29/2010 15:25, Marcus Agehall (nu med K-märkt fastighet) @ Pike (-) developers forum wrote:
Not sure I understand your question.
It's a plain race condition between your worker thread and the rest of the system.
What happens is that your queue will continue to process data (even if it's just your quit-command) while the rest of the system assumes your module is all done and can be destructed. If module manages to destroy some variables in your module before your worker thread is done, chances are you'll see the error.
If you get this type of error, it means that something was still running while it shouldn't be. You should never expect to see this type of error if your threading is done correctly.