diff options
author | David Faure <david.faure@kdab.com> | 2013-03-18 15:19:44 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-22 16:44:51 +0100 |
commit | f4609b202208fe592d24c7ae3b4a48ee83045497 (patch) | |
tree | c9827efe74688595664c379085ba2a6267e49c13 /src/corelib/io/qprocess_unix.cpp | |
parent | 85b25fc22176b574865813fa53f7eb2fcbdc89bf (diff) |
QThread: fix race when setting the eventDispatcher
Use QAtomicPointer to make this thread-safe.
Change-Id: If71f204699fcefabdb59bd26342d777d1cc9e2a7
Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
Diffstat (limited to 'src/corelib/io/qprocess_unix.cpp')
-rw-r--r-- | src/corelib/io/qprocess_unix.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/corelib/io/qprocess_unix.cpp b/src/corelib/io/qprocess_unix.cpp index 997848851d..7f7066271b 100644 --- a/src/corelib/io/qprocess_unix.cpp +++ b/src/corelib/io/qprocess_unix.cpp @@ -380,7 +380,7 @@ bool QProcessPrivate::createChannel(Channel &channel) return false; // create the socket notifiers - if (threadData->eventDispatcher) { + if (threadData->hasEventDispatcher()) { if (&channel == &stdinChannel) { channel.notifier = new QSocketNotifier(channel.pipe[1], QSocketNotifier::Write, q); @@ -562,7 +562,7 @@ void QProcessPrivate::startProcess() return; } - if (threadData->eventDispatcher) { + if (threadData->hasEventDispatcher()) { startupSocketNotifier = new QSocketNotifier(childStartedPipe[0], QSocketNotifier::Read, q); QObject::connect(startupSocketNotifier, SIGNAL(activated(int)), |