move the elapsed time object into the performMatch method; this prevents access by multiple threads by putting a unique QTime object in each thread. thanks Hellgrind (and maelcum for running it)
svn path=/trunk/KDE/kdelibs/; revision=1032955
This commit is contained in:
parent
38884ccd1a
commit
fad3e0814b
@ -93,7 +93,6 @@ public:
|
||||
RunnerScript *script;
|
||||
KPluginInfo runnerDescription;
|
||||
AbstractRunner *runner;
|
||||
QTime runtime;
|
||||
int fastRuns;
|
||||
Package *package;
|
||||
QHash<QString, QAction*> actions;
|
||||
@ -155,13 +154,14 @@ void AbstractRunner::performMatch(Plasma::RunnerContext &localContext)
|
||||
static const int reasonableRunTime = 1500;
|
||||
static const int fastEnoughTime = 250;
|
||||
|
||||
d->runtime.restart();
|
||||
QTime time;
|
||||
time.restart();
|
||||
|
||||
//The local copy is already obtained in the job
|
||||
match(localContext);
|
||||
|
||||
// automatically rate limit runners that become slooow
|
||||
const int runtime = d->runtime.elapsed();
|
||||
const int runtime = time.elapsed();
|
||||
bool slowed = speed() == SlowSpeed;
|
||||
|
||||
if (!slowed && runtime > reasonableRunTime) {
|
||||
|
Loading…
Reference in New Issue
Block a user