don't forget to unlock that lock; hopefully fixes krunner hangs.

svn path=/trunk/KDE/kdelibs/; revision=1036628
This commit is contained in:
Andreas Hartmetz 2009-10-17 13:55:18 +00:00
parent 66dff7cf72
commit 191256f279

View File

@ -248,7 +248,12 @@ AbstractRunner::Speed AbstractRunner::speed() const
// or if we were fast and are going to slow down; so don't wait in this case, just // or if we were fast and are going to slow down; so don't wait in this case, just
// say we're slow. we either will be soon or were just a moment ago and it doesn't // say we're slow. we either will be soon or were just a moment ago and it doesn't
// hurt to do one more run the slow way // hurt to do one more run the slow way
return d->speedLock.tryLockForRead() ? d->speed : SlowSpeed; if (!d->speedLock.tryLockForRead()) {
return SlowSpeed;
}
Speed s = d->speed;
d->speedLock.unlock();
return s;
} }
void AbstractRunner::setSpeed(Speed speed) void AbstractRunner::setSpeed(Speed speed)