https://bugs.kde.org/show_bug.cgi?id=392768

Kevin Funk <kf...@kde.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|CONFIRMED                   |RESOLVED
      Latest Commit|                            |https://commits.kde.org/kio
                   |                            |/27271405f4085bd8a398d41a75
                   |                            |ac52cb4f857efd
         Resolution|---                         |FIXED

--- Comment #15 from Kevin Funk <kf...@kde.org> ---
Git commit 27271405f4085bd8a398d41a75ac52cb4f857efd by Kevin Funk, on behalf of
Julien Goodwin.
Committed on 09/01/2020 at 14:17.
Pushed by kfunk into branch 'master'.

SlaveBase::dispatchLoop: Fix timeout calculation

Summary:
Old version of the code:
  ms = qMax<int>(d->nextTimeout.elapsed() - d->nextTimeoutMsecs, 1);

... will mean the sleep is for as long as the timer has run *minus* the
intended duration, so if nextTimeoutMsecs is ever set and the timer just
started this becomes very negative, and 1ms is the result.

Inverting the subtraction:
  ms = qMax<int>(d->nextTimeoutMsecs - d->nextTimeout.elapsed(), 1);

Means sleeping for the remaining time, and so far my CPU seems much
happier, with my KIO-HTTP using apps looking fine.

Reviewers: chinmoyr, davidedmundson, dfaure, broulik

Reviewed By: dfaure

Subscribers: ngraham, kde-frameworks-devel

Tags: #frameworks

Differential Revision: https://phabricator.kde.org/D26364

M  +1    -1    src/core/slavebase.cpp

https://commits.kde.org/kio/27271405f4085bd8a398d41a75ac52cb4f857efd

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to