diff options
author | Milian Wolff <milian.wolff@kdab.com> | 2014-12-03 18:50:54 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2014-12-09 18:34:52 +0100 |
commit | 2d8bbf16db9b7e2e348495dd7d52ae017bd00a49 (patch) | |
tree | e035b7cc3f87f6e890ade19bf6c48a4e14a8da1a /src/3rdparty | |
parent | 80963d1d3380648191905e4fd0a5bc06f6af7ee6 (diff) |
Optimize: Do not allocate the state name every time.
The compiler is not smart enough to get rid of this call, even
when the debug() function is not doing anything.
Upstream should be fixed to use categorized logging instead,
which would not have this problem.
Change-Id: I70ed344cce0dc2130d3aa96f3873ffc4799f6d60
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/3rdparty')
-rw-r--r-- | src/3rdparty/threadweaver/src/weaver.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/3rdparty/threadweaver/src/weaver.cpp b/src/3rdparty/threadweaver/src/weaver.cpp index 37fcf24bd..5f2df89fb 100644 --- a/src/3rdparty/threadweaver/src/weaver.cpp +++ b/src/3rdparty/threadweaver/src/weaver.cpp @@ -542,10 +542,14 @@ JobPointer Weaver::takeFirstAvailableJobOrSuspendOrWait(Thread *th, bool threadW { QMutexLocker l(m_mutex); Q_UNUSED(l); Q_ASSERT(threadWasBusy == false || (threadWasBusy == true && m_active > 0)); + +#ifndef QT_NO_DEBUG debug(3, "WeaverImpl::takeFirstAvailableJobOrWait: trying to assign new job to thread %i (%s state).\n", th->id(), qPrintable(state()->stateName())); debug(5, "WeaverImpl::takeFirstAvailableJobOrWait: %i active threads, was busy: %s, suspend: %s, assign new job: %s.\n", activeThreadCount(), threadWasBusy ? "yes" : "no", suspendIfInactive ? "yes" : "no", !justReturning ? "yes" : "no"); +#endif + if (threadWasBusy) { // cleanup and send events: decActiveThreadCount(); |