Set Thread Priority In QtConcurrent
How to set thread priority for concurrent threads (QtConcurrent)
QThread class have method setPriority(), but QtConcurrent doesn’t. So i write own implementation with using call_once function. But current C++ standard does not have this function, it’s only in C++0x and BOOST. After some googling i found few implementations and select one. QAtomicInt not ideal class for create thread-safe code and i had to use few undocumented features like QBasicAtomicInt, because it POD type and can be initialized statically inside executable file before all potential parallel initializations inside concurrent threads.
This is example how to use this functions for set thread priority once per thread at run:
Source [forum.crossplatform.ru]
P.S.: this implementation faster than boost::call_once, but slower than std::call_once