diff options
author | Shane Kearns <shane.kearns@accenture.com> | 2011-10-06 15:40:34 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2011-10-11 19:16:10 +0200 |
commit | 82d897febfa948a011f194bd7c4255c42fa8b780 (patch) | |
tree | 787519188fe2dc69fcc3d014eb90ae6d2c4cbd31 /configure | |
parent | 32ec981745e6abc9532a443f2e88c465a2fdb480 (diff) |
Fix construction races in QtNetwork
When two threads construct a QNetworkAccessManager at exactly the
same time on an SMP system, there are construction races for some
Q_GLOBAL_STATIC data. This is normal and expected - the losing
thread deletes its instance as part of the Q_GLOBAL_STATIC macro.
For QNetworkAccessBackendFactoryData, a guard mechanism intended
to prevent the data being reconstructed by destructors of other
global static classes was being set by the loser.
To fix this, the bool is changed to a QAtomicInt. In the normal
case, it will have value 0->1 on startup and 1->0 on shutdown.
In the race case, it will have values 0->1->2->1 on startup and
1->0 on shutdown.
Task-Number: QTBUG-20343
Change-Id: Ie3fe38944d10809d1ccdbe772df82d67faffe19c
Reviewed-on: http://codereview.qt-project.org/6181
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Peter Hartmann <peter.hartmann@nokia.com>
Diffstat (limited to 'configure')
0 files changed, 0 insertions, 0 deletions