QPointer and thread safety
The Qt docs on QPointers don't specifically mention anything about thread safety. If used across multiple threads, do they somehow magically guarantee that the object doesn't get deleted between the check and the usage?
Code:
if (p!=0)
p->doSomething();
Looking at the source code it appears that they are not thread safe. True? If so, then I'll submit a sug to have the docs updated.
-RobF
Re: QPointer and thread safety
What does the above have to do with thread-safety? First of all you are asking whether the operation is atomic not thread-safe and second of all these are two separate instructions with two separate calls to QPointer thus the thread can be interrupted somewhere inbetween the check and the call (so "if" is not atomic).