Details
-
Bug
-
Resolution: Done
-
Not Evaluated
-
4.7.4, 4.8.3
-
None
-
85b24bb2dea97c3a9b013bacd5a422b26fe5d14b
Description
Further to the bug summary.
The src/corelib/concurrent/qthreadpool.cpp at QThreadPoolPrivate::acrtiveTghreadCount() it does not take a mutex to atomically read and perform arithmetic so a consistent return value is.
The documentation should say the property is thread-safe (as in no harm will result from concurrent execution) but that he return value maybe inconsistent due to no internal locking.
It is not clear (to me at least) if having a consistent view is useful anyway. i.e. so what if you get the correct value 100% of the time by the time you perform any action it could be out-of-date (certainly for the globalInstance() case).