diff options
author | Thiago Macieira <thiago.macieira@intel.com> | 2016-08-29 19:40:24 -0700 |
---|---|---|
committer | Thiago Macieira <thiago.macieira@intel.com> | 2016-08-30 21:52:04 +0000 |
commit | 84830fc07d65d58fce9b24b5ec8f1224b0969ac0 (patch) | |
tree | 0be365109637e660f8d964fc1defd409460e4c5c /src/widgets | |
parent | eebdb16c63376bf7b8087cce82517a01abd573a3 (diff) |
QLockFile::tryLock: prevent over-sleeping in certain cases
The sleep time increases exponentially, but we never checked whether the
time to sleep was less than the remaining time. For example, if timeout
was 4000 ms on entry, we'd progressively sleep 100 ms, 200, 400, 800,
1600 ms. At this point, the accummulated sleep time would be 3100 ms and
the next sleep should be no more than 900 ms.
Prior to this change, the tryLock() would then proceed to sleep 3200 ms,
for a total wait time of 6300 ms, or 57.5% above the timeout provided by
the user.
Change-Id: Ifc295639c8cf4ddcaa69fffd146f7586a7ee95e4
Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'src/widgets')
0 files changed, 0 insertions, 0 deletions