diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2016-10-14 10:37:57 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2016-10-19 13:25:01 +0000 |
commit | 46078f33745659ec1770cb4a58f8e02b5a9f670b (patch) | |
tree | 72dac0bc7c206a61149becc3e478a814334554e3 /tests | |
parent | 8249f490ff82ee2a223d2c64661cfcb1c24bdeb4 (diff) |
QOrderedMutexLocker: unlock in reverse order of locking
This is an improvement for the following reasons:
- Should mutex locking allocate any kind of resource,
unlocking in reverse order will free those resources
in inverse order, which helps typical allocators.
- If the lock pair is contended, by unlocking in the
same order as locking, we were allowing the waiting
thread to wake up to take the first lock just to
find that the second lock is still held by someone
else.
The order of unlocking has no influence on the correct-
ness of the algorithm.
Change-Id: Id16b0342aef325c14a7bd8836d3a75db68ef2588
Reviewed-by: David Faure <david.faure@kdab.com>
Diffstat (limited to 'tests')
0 files changed, 0 insertions, 0 deletions