D14302: Don't block forever in ensureKdeinitRunning

Thiago Macieira noreply at phabricator.kde.org
Tue Jul 24 02:10:31 BST 2018


thiago added a comment.


  In D14302#296479 <https://phabricator.kde.org/D14302#296479>, @dfaure wrote:
  
  > I agree about tryLock(0) should return immediately, tryLock(-1) should block forever -- I wrote that code and that docu ;-)
  >
  > Thiago wrote QDeadLineTimer later on though, and ported QLockFile to it. Thiago, any input?
  
  
  QDT has no escape path for 0. The constructor calls setRemainngTime(0), which calls setPreciseRemainingTime(0, 0), which will get the current time, add zero, and store it.
  
  After all of that, the QDT should return that the remaining time is zero, since it's expired.
  
  remainingTime() calls remainingTimeNSecs(), which calls rawRemainingTimeNSecs(), which should return a negative value. remainingTimeNSecs() should detect the negative and return 0; remainingTime detects the zero and returns it.
  
    (gdb) print timer.remainingTime()
    $11 = -1
  
  That's not supposed to happen.

REPOSITORY
  R271 KDBusAddons

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

To: jtamate, dfaure, #frameworks, thiago
Cc: kde-frameworks-devel, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20180724/342729db/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list