qt5base-lts/tests/auto/corelib
Thiago Macieira 634f82f1f1 Add a testAndSet overload to the atomics that returns the current value
This is extremely useful, since the most common action after a failed
compare-and-swap is to loop around, trying again with the current
value as found in memory.

Code currently written as:
    do {
        Type value = atomic.load();
        ...
    } while (!atomic.testAndSetRelaxed(value, desired));

Becomes:
    Type value = atomic.load();
    do {
        ...
    } while (!atomic.testAndSetRelaxed(value, desired, value));

In most CPU architectures, the value that was found in memory is known
to the compare-and-swap code, so this is more efficient than the
previous code. In architectures where the value is not known, the new
code is no worse than before.

The implementation sometimes modified an existing function, sometimes
it added a new one, depending on whether more registers were needed in
the assembly (like ARMv6-7), the code became more complex (ARMv5), the
optimizer failed (C++11), or it was just plain equivalent (MIPS).

Change-Id: I7d6d200ea9746ec8978a0c1e1969dbc3580b9285
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2014-02-16 05:12:26 +01:00
..
animation tst_qpauseanimation: Fix condition in QEXPECT_FAIL. 2014-01-30 22:10:22 +01:00
codecs Fix compilation after b0afad8f0b 2014-02-07 04:47:12 +01:00
global Merge remote-tracking branch 'origin/stable' into dev 2014-02-12 16:28:07 +01:00
io Add const overload for QLoggingCategory::operator()() 2014-02-15 21:57:43 +01:00
itemmodels Merge remote-tracking branch 'origin/stable' into dev 2014-02-07 13:07:25 +01:00
json Added constructor to QJsonValue for const char * 2014-01-16 21:49:26 +01:00
kernel tst_qsignalblocker: simplify test 2014-02-16 00:18:32 +01:00
mimetypes test: Don't build qmimedatabase-cache for QNX 2014-01-16 16:11:04 +01:00
plugin qcompilerdetection.h: add Q_COMPILER_UNIFORM_INIT 2013-11-15 06:30:53 +01:00
statemachine don't erroneously claim that gui support is needed 2013-10-16 17:10:15 +02:00
thread Add a testAndSet overload to the atomics that returns the current value 2014-02-16 05:12:26 +01:00
tools Add qHash() overloads for floating-point types 2014-02-16 00:18:32 +01:00
xml Check for network module when building according auto tests 2013-02-19 19:20:53 +01:00
corelib.pro iOS: Enable building of basic tests 2014-01-22 12:35:17 +01:00