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