Fix build with latest ThreadWeaver
REVIEW: 113535
This commit is contained in:
parent
3fde4633e6
commit
f114f7310d
@ -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
|
||||||
|
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user