Fix build with latest ThreadWeaver

REVIEW: 113535
This commit is contained in:
Christoph Feck 2013-11-01 19:08:45 +01:00
parent 3fde4633e6
commit f114f7310d
2 changed files with 1 additions and 21 deletions

View File

@ -86,24 +86,6 @@ private:
QMutex m_mutex; QMutex m_mutex;
}; };
/* ThreadWeaver work around:
* There is no method exposed that allows us to inform
* ThreadWeaver that a previously unavailable job is now
* available; thus, we use an empty job to wake up the threads
*/
class DummyJob : public ThreadWeaver::Job
{
public:
DummyJob(QObject *parent) : Job(), m_decorator(new ThreadWeaver::QObjectDecorator(this, parent)) {}
~DummyJob() {}
ThreadWeaver::QObjectDecorator* decorator() const { return m_decorator; }
private:
virtual void run(ThreadWeaver::JobPointer, ThreadWeaver::Thread*) {}
ThreadWeaver::QObjectDecorator* m_decorator;
};
/* /*
* FindMatchesJob class * FindMatchesJob class
* Class to run queries in different threads * Class to run queries in different threads

View File

@ -384,15 +384,13 @@ public:
void unblockJobs() void unblockJobs()
{ {
// WORKAROUND: Queue an empty job to force ThreadWeaver to awaken threads
if (searchJobs.isEmpty() && Weaver::instance()->isIdle()) { if (searchJobs.isEmpty() && Weaver::instance()->isIdle()) {
oldSearchJobs.clear(); oldSearchJobs.clear();
checkTearDown(); checkTearDown();
return; return;
} }
DummyJob *dummy = new DummyJob(q); Weaver::instance()->reschedule();
Weaver::instance()->enqueueRaw(dummy);
} }
void runnerMatchingSuspended(bool suspended) void runnerMatchingSuspended(bool suspended)