D26364: SlaveBase::dispatchLoop: Fix timeout calculation

2020-01-09 Thread Kevin Funk
This revision was automatically updated to reflect the committed changes.
Closed by commit R241:27271405f408: SlaveBase::dispatchLoop: Fix timeout 
calculation (authored by Julien Goodwin jgood...@studio442.com.au, 
committed by kfunk).

REPOSITORY
  R241 KIO

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D26364?vs=72610=73129

REVISION DETAIL
  https://phabricator.kde.org/D26364

AFFECTED FILES
  src/core/slavebase.cpp

To: kfunk, chinmoyr, davidedmundson, dfaure, broulik
Cc: ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26364: SlaveBase::dispatchLoop: Fix timeout calculation

2020-01-03 Thread David Faure
dfaure accepted this revision.
dfaure added a comment.
This revision is now accepted and ready to land.


  Yep. Bug in D9983 .

REPOSITORY
  R241 KIO

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D26364

To: kfunk, chinmoyr, davidedmundson, dfaure, broulik
Cc: ngraham, kde-frameworks-devel, LeGast00n, GB_2, michaelh, bruns


D26364: SlaveBase::dispatchLoop: Fix timeout calculation

2020-01-02 Thread Kevin Funk
kfunk added a reviewer: broulik.

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D26364

To: kfunk, chinmoyr, davidedmundson, dfaure, broulik
Cc: kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns


D26364: SlaveBase::dispatchLoop: Fix timeout calculation

2020-01-02 Thread Kevin Funk
kfunk added reviewers: chinmoyr, davidedmundson, dfaure.

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D26364

To: kfunk, chinmoyr, davidedmundson, dfaure
Cc: kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns


D26364: SlaveBase::dispatchLoop: Fix timeout calculation

2020-01-02 Thread Kevin Funk
kfunk created this revision.
Herald added a project: Frameworks.
Herald added a subscriber: kde-frameworks-devel.
kfunk requested review of this revision.

REVISION SUMMARY
  Old version of the code:
  
ms = qMax(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(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.
  
  BUG: 392768

REPOSITORY
  R241 KIO

BRANCH
  master

REVISION DETAIL
  https://phabricator.kde.org/D26364

AFFECTED FILES
  src/core/slavebase.cpp

To: kfunk
Cc: kde-frameworks-devel, LeGast00n, GB_2, michaelh, ngraham, bruns