qt5base-lts/src
Marc Mutz 373a7277db QDBusMetaTypeId: don't cache the result of qMetaTypeId<>() in static ints
There's not much point in caching the result of qMetaTypeId<>,
because it's already internally memoised.

In addition, the code that initialised the static int caches wasn't
protected against concurrent access under the assumption that the
operations performed were thread-safe.

That is true for most of them, but not for the stores to the static ints,
which race against each other:

   // Thread A               // Thread B
   r1 = initialized /*=false*/
                             r1 = initialized /*=false*/
   r2 = qMetaTypeId<...>();
                             r2 = qMetaTypeId<...>();
   message = r2;             message = r2; // race, ditto for all other ints

To fix, turn the ints into inline functions that just call the respective
qMetaTypeId<>() function.

Change-Id: I5aa80c624872c3867232abc26ffdcde70cd54022
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2012-09-22 19:19:37 +02:00
..
3rdparty A step out from Harfbuzz (reduce dependency) 2012-09-22 00:47:40 +02:00
concurrent concurrent: Fix missing or improper include guard in headers 2012-09-15 23:54:29 +02:00
corelib A step out from Harfbuzz (reduce dependency) 2012-09-22 00:47:40 +02:00
dbus QDBusMetaTypeId: don't cache the result of qMetaTypeId<>() in static ints 2012-09-22 19:19:37 +02:00
gui A step out from Harfbuzz (reduce dependency) 2012-09-22 00:47:40 +02:00
network Fix build under MinGW after 1e3269c086 2012-09-22 00:47:40 +02:00
opengl Move opengl/wid/net example docs to proper folders. 2012-09-21 19:59:06 +02:00
platformsupport Correct QSpiAccessibleBridge::setRootObject definition 2012-09-22 19:03:16 +02:00
plugins Cocoa GL context: do not crash when closing windows 2012-09-20 07:02:00 +02:00
printsupport printsupport: Include own headers first 2012-09-19 22:27:11 +02:00
sql Move opengl/wid/net example docs to proper folders. 2012-09-21 19:59:06 +02:00
testlib Fix qtestlib-manual.qdoc errors. 2012-09-13 19:33:08 +02:00
tools QDBusMetaTypeId: don't cache the result of qMetaTypeId<>() in static ints 2012-09-22 19:19:37 +02:00
widgets QGtkStyle: remove an unnecessary sanity check for theme name 2012-09-22 00:47:40 +02:00
winmain remove mentions of borland from project files 2012-09-19 19:54:44 +02:00
xml Move opengl/wid/net example docs to proper folders. 2012-09-21 19:59:06 +02:00
src.pro src.pro: remove redundant & incorrect platformsupport dependency 2012-08-25 10:29:53 +02:00