diff options
| author | Shane Kearns <shane.kearns@accenture.com> | 2011-11-30 13:39:23 (GMT) | 
|---|---|---|
| committer | Shane Kearns <shane.kearns@accenture.com> | 2011-11-30 14:47:43 (GMT) | 
| commit | 67d146092a6c11f1ca3c622ae0737202ca292a58 (patch) | |
| tree | 170825dfe25f77557e69b7f77ffba0a442260af4 /doc/src/snippets/code/src_script_qscriptcontext.cpp | |
| parent | 951e46bc21168cb66780f932006ec41b7dfea234 (diff) | |
| download | Qt-67d146092a6c11f1ca3c622ae0737202ca292a58.zip Qt-67d146092a6c11f1ca3c622ae0737202ca292a58.tar.gz Qt-67d146092a6c11f1ca3c622ae0737202ca292a58.tar.bz2 | |
Backport SMP safe initialisation of QNetworkConfigurationManager
The original commit in Qt5 uses new atomics API that is not
in Qt4. I have replaced with equivalent calls.
Also the init/cleanup functions are different, so those are renamed.
Reviewed-by: mread
Task-number: ou1cimx1#946677
Original commit message follows:
Author: Thiago Macieira <thiago@kde.org>
Date:   Wed Jul 6 00:06:15 2011 +0200
    Fix the QNetworkConnectionManagerPrivate initialisation code.
    The current code was meant to be a thread-safe initialisation that
    also ran a couple of extra steps. But it wasn't. While it's ok to call
    qAddPostRoutine(), the call to updateConfigurations() was
    thread-unsafe. It is possible that another thread got the pointer to
    the Private before updateConfigurations() finished.
    So instead protect the initialisation with a mutex.
    It's possible that the value of the pointer becomes visible to
    other processors before the other contained values, so use
    atomics here.
    To call qAddPostRoutine safely from the main thread, use the trick
    of deleteLater() (which is thread-safe) in another thread connecting
    to a slot.
Diffstat (limited to 'doc/src/snippets/code/src_script_qscriptcontext.cpp')
0 files changed, 0 insertions, 0 deletions
