summaryrefslogtreecommitdiffstats
path: root/src/network
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@nokia.com>2010-04-19 21:02:54 +0200
committerThiago Macieira <thiago.macieira@nokia.com>2010-04-20 10:13:45 +0200
commit075930ccd951cadcc83d30c5fc8c69e343ed70b8 (patch)
tree88eb431dad1a6851d700ad53111e58004622c421 /src/network
parent5fd58b2ec197ea40506442f7d7b62d1e74338381 (diff)
Don't rely on tryStart() to do job control.
It may fail but threads become available the next instant. Instead, simply use our own currentLookups count. Reviewed-by: Markus Goetz
Diffstat (limited to 'src/network')
-rw-r--r--src/network/kernel/qhostinfo.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/network/kernel/qhostinfo.cpp b/src/network/kernel/qhostinfo.cpp
index 68949789fa..2dd6485cfb 100644
--- a/src/network/kernel/qhostinfo.cpp
+++ b/src/network/kernel/qhostinfo.cpp
@@ -551,13 +551,11 @@ void QHostInfoLookupManager::work()
}
}
- if (scheduled && threadPool.tryStart(scheduled)) {
+ if (scheduled && currentLookups.size() < threadPool.maxThreadCount()) {
// runnable now running in new thread, track this in currentLookups
+ threadPool.start(scheduled);
iterator.remove();
currentLookups.append(scheduled);
- } else if (scheduled) {
- // wanted to start, but could not because thread pool is busy
- break;
} else {
// was postponed, continue iterating
continue;