QThreadPool: fix typos
Task-number: QTBUG-31919 Change-Id: I2718566595622895f182191b5693e91c1ab1e7d0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
This commit is contained in:
parent
e8bc599a74
commit
37dc44d499
@ -52,14 +52,14 @@ QT_BEGIN_NAMESPACE
|
|||||||
Q_GLOBAL_STATIC(QThreadPool, theInstance)
|
Q_GLOBAL_STATIC(QThreadPool, theInstance)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
QThread wrapper, provides synchronizitaion against a ThreadPool
|
QThread wrapper, provides synchronization against a ThreadPool
|
||||||
*/
|
*/
|
||||||
class QThreadPoolThread : public QThread
|
class QThreadPoolThread : public QThread
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
QThreadPoolThread(QThreadPoolPrivate *manager);
|
QThreadPoolThread(QThreadPoolPrivate *manager);
|
||||||
void run();
|
void run();
|
||||||
void registerTheadInactive();
|
void registerThreadInactive();
|
||||||
|
|
||||||
QThreadPoolPrivate *manager;
|
QThreadPoolPrivate *manager;
|
||||||
QRunnable *runnable;
|
QRunnable *runnable;
|
||||||
@ -103,7 +103,7 @@ void QThreadPoolThread::run()
|
|||||||
qWarning("Qt Concurrent has caught an exception thrown from a worker thread.\n"
|
qWarning("Qt Concurrent has caught an exception thrown from a worker thread.\n"
|
||||||
"This is not supported, exceptions thrown in worker threads must be\n"
|
"This is not supported, exceptions thrown in worker threads must be\n"
|
||||||
"caught before control returns to Qt Concurrent.");
|
"caught before control returns to Qt Concurrent.");
|
||||||
registerTheadInactive();
|
registerThreadInactive();
|
||||||
throw;
|
throw;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -121,7 +121,7 @@ void QThreadPoolThread::run()
|
|||||||
} while (r != 0);
|
} while (r != 0);
|
||||||
|
|
||||||
if (manager->isExiting) {
|
if (manager->isExiting) {
|
||||||
registerTheadInactive();
|
registerThreadInactive();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -129,7 +129,7 @@ void QThreadPoolThread::run()
|
|||||||
bool expired = manager->tooManyThreadsActive();
|
bool expired = manager->tooManyThreadsActive();
|
||||||
if (!expired) {
|
if (!expired) {
|
||||||
++manager->waitingThreads;
|
++manager->waitingThreads;
|
||||||
registerTheadInactive();
|
registerThreadInactive();
|
||||||
// wait for work, exiting after the expiry timeout is reached
|
// wait for work, exiting after the expiry timeout is reached
|
||||||
expired = !manager->runnableReady.wait(locker.mutex(), manager->expiryTimeout);
|
expired = !manager->runnableReady.wait(locker.mutex(), manager->expiryTimeout);
|
||||||
++manager->activeThreads;
|
++manager->activeThreads;
|
||||||
@ -139,13 +139,13 @@ void QThreadPoolThread::run()
|
|||||||
}
|
}
|
||||||
if (expired) {
|
if (expired) {
|
||||||
manager->expiredThreads.enqueue(this);
|
manager->expiredThreads.enqueue(this);
|
||||||
registerTheadInactive();
|
registerThreadInactive();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void QThreadPoolThread::registerTheadInactive()
|
void QThreadPoolThread::registerThreadInactive()
|
||||||
{
|
{
|
||||||
if (--manager->activeThreads == 0)
|
if (--manager->activeThreads == 0)
|
||||||
manager->noActiveThreads.wakeAll();
|
manager->noActiveThreads.wakeAll();
|
||||||
@ -262,7 +262,7 @@ void QThreadPoolPrivate::startThread(QRunnable *runnable)
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\internal
|
\internal
|
||||||
Makes all threads exit, waits for each tread to exit and deletes it.
|
Makes all threads exit, waits for each thread to exit and deletes it.
|
||||||
*/
|
*/
|
||||||
void QThreadPoolPrivate::reset()
|
void QThreadPoolPrivate::reset()
|
||||||
{
|
{
|
||||||
@ -322,8 +322,8 @@ void QThreadPoolPrivate::clear()
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
\internal
|
\internal
|
||||||
Seaches for \a runnable in the queue, removes it from the queue and
|
Searches for \a runnable in the queue, removes it from the queue and
|
||||||
runs it if found. This functon does not return until the runnable
|
runs it if found. This function does not return until the runnable
|
||||||
has completed.
|
has completed.
|
||||||
*/
|
*/
|
||||||
void QThreadPoolPrivate::stealRunnable(QRunnable *runnable)
|
void QThreadPoolPrivate::stealRunnable(QRunnable *runnable)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user