*/
void QThreadPool::start(QRunnable *runnable, int priority)
{
- if (!runnable) {
+ if (Q_UNLIKELY(!runnable)) {
return;
}
*/
bool QThreadPool::tryStart(QRunnable *runnable)
{
- if (!runnable) {
+ if (Q_UNLIKELY(!runnable)) {
return false;
}
Q_D(QThreadPool);
QMutexLocker locker(&d->mutex);
- if (maxThreadCount == d->maxThreadCount)
+ if (maxThreadCount == d->maxThreadCount) {
return;
+ }
d->maxThreadCount = maxThreadCount;
d->tryToStartMoreThreads();
bool QThreadPool::waitForDone(int msecs)
{
Q_D(QThreadPool);
- bool rc = d->waitForDone(msecs);
+ const bool rc = d->waitForDone(msecs);
if (rc) {
d->reset();
}