summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-013-9/+10
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/qnx-x86-qcc/qplatformdefs.h src/corelib/global/qglobal.h src/network/socket/qnativesocketengine_winrt.cpp src/plugins/platforms/android/androidjniaccessibility.cpp src/plugins/platforms/windows/qwindowswindow.cpp Manually adjusted: mkspecs/qnx-armle-v7-qcc/qplatformdefs.h to include 9ce697f2d54be6d94381c72af28dda79cbc027d4 Thanks goes to Sergio for the qnx mkspecs adjustments. Change-Id: I53b1fd6bc5bc884e5ee2c2b84975f58171a1cb8e
| * Add a comment stating QMutex::isRecursive should be made const in Qt6Olivier Goffart2014-06-261-1/+1
| | | | | | | | | | Change-Id: I452b0764790112c59af77bc8d95f403ff37cbc4a Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
| * Fix QMutex documentation saying some function are static while they are notOlivier Goffart2014-06-262-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | qdoc only see a fake QMutex class (the same as the one built in bootstrap) But that fake QMutex had static member while the normal QMutex class has non static member. QMutexLocker::mutex is also a const function in the real QMutexLocker Task-number: QTBUG-38522 Change-Id: I220434ffc6a9e990029f770e2536ecb55b4e2182 Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
| * Doc: QAtomicInteger first appeared in Qt 5.3David Faure2014-06-091-0/+1
| | | | | | | | | | Change-Id: I900e5b0ec8291d34685cb545540a5a9f54551d05 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | winrt: Fix main thread dispatcher creationAndrew Knight2014-06-281-1/+1
| | | | | | | | | | | | | | | | Don't create a dispatcher for all adopted threads, only the main thread. This was causing the GUI thread to skip platform dispatcher creation. Change-Id: Id0de976f9def48e8d58efd20815b6fd18faebefa Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* | winrt: Use native threadingAndrew Knight2014-06-254-154/+479
|/ | | | | | | | | | | | | | | | | Instead of using std::thread, use the WinRT ThreadPool to manage threads. This allows for setting the scheduling priority, and provides a path to enable XAML integration (which requires Qt run on a background thread). QThread::terminate() is still unsupported, and only the winmain thread can be adopted due to the behavior of the thread pool when creating tasks from the GUI thread. The associated tests are now skipped, and all other QThread tests pass. Task-number: QTBUG-31397 Change-Id: Ib512a328412e1dffecdc836bc39de3ccd37afa13 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Fix typos in comments (qfreelist and qmutex)David Faure2014-05-261-1/+1
| | | | | Change-Id: I782b18b9f82a72a29371564838252e1838faf86c Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* WinRT: Don't use the native thread handle for waitingAndrew Knight2014-04-161-15/+6
| | | | | | | | | | | There is no guarantee that the handle from std::thread will be valid when a wait is made. Instead, simply use an elapsed timer and check if the thread is finished. This prevents an exception from being thrown when a bad handle is encountered. Task-number: QTBUG-31397 Change-Id: Ie2a7e6cbfbb27bf1baff779322670d85e92e10dd Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* Use the new 3-operand testAndSet functions in QMutexThiago Macieira2014-04-052-6/+12
| | | | | | | | | This allows us to get the current value of the QMutex / QBasicMutex after the testAndSet operation failed. It saves an extra load from memory. Change-Id: I4922a8b3df15e342b177b13f56cf4f1184314520 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* WinRT: Use native wait methods instead of std::thread's sleep_forAndrew Knight2014-03-061-4/+4
| | | | | | | | | sleep_for appears to be unreliable (resulting in infinite waits) when used in a thread which is also using native waiting methods. This is also a step in the direction of eliminating std::thread's usage in WinRT. Change-Id: I58bc4bf9ada25de247849333ef925964676b7239 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* Atomics: implement fetchAndSub on top of fetchAndAddThiago Macieira2014-03-041-6/+2
| | | | | | | | | Instead of looping unnecessarily on top of testAndSet. Task-number: QTBUG-37031 Change-Id: I8120f8405eb76dccc9066749cee0a92b0f2da20e Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Sergio Ahumada <sahumada@blackberry.com>
* Add the rest of the non-volatile members of std::atomic to QBasicAtomicThiago Macieira2014-02-164-3/+656
| | | | | | | | | | [ChangeLog][QtCore][Atomic support]Added more operations to the atomic classes, including operator T(), operator=(T), operator++, operator--. For the QAtomicInteger, bit-manipulation operations are also provided, both in operator and in fetchAndXxxYyyyyy modes. Change-Id: I39c07be74e15e0a48f9e931f4342b182004dee1a Reviewed-by: David Faure <david.faure@kdab.com>
* Add a testAndSet overload to the atomics that returns the current valueThiago Macieira2014-02-162-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* WinRT: Fix use of std::thread in QThreadAndrew Knight2014-02-101-4/+4
| | | | | | | | Don't delete the thread object without detaching it, use detach() instead of CloseHandle(), and avoid a double-delete. Change-Id: Ia169a96fb32805e06abe099c3c35e97ce485f088 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* Use full-barrier in the "non-atomic" API in QAtomic{Int,Integer,Pointer}Thiago Macieira2014-01-301-4/+4
| | | | | | | This is more in line with what std::atomic does. Change-Id: I6fe96102995a3fda8f82475758995593358735bc Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Replace the type-based QAtomicIntegerTraits with a size-based oneThiago Macieira2014-01-302-15/+4
| | | | | | | | This simplifies the code a lot and avoids silly mistakes where a specific integer type is missing (such as char16_t). Change-Id: Id91dfd1919e783e0a9af7bfa093ca560a01b22d1 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Centralize support for QBasicAtomic for ints and longsThiago Macieira2014-01-302-1/+39
| | | | | | | No need to redefine everywhere, since they're required to be supported. Change-Id: I2bdbbd0b0c44871e3bd0edcf0289fc58dd50ff31 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Ensure that the pointer-sized QAtomicInteger specialization existsThiago Macieira2014-01-301-1/+15
| | | | | | | | | | | | | | | | | | | This is already implemented in qatomic_x86.h, qatomic_ia64.h, qatomic_mips.h, qatomic_armv6.h, and qatomic_cxx11.h. For qatomic_msvc.h, we've just fixed it. For qatomic_gcc.h, we know that the compiler supports it, so just add it. According to the GCC manual, it might print a warning on some platforms, so we only enable that on 64-bit builds. For qatomic_unix.h, the support was missing (along with support for unsigned 32-bit), so this commits adds it. For qatomic_armv5.h, the platform does not always support 64-bit atomics, but ARMv5 cannot compile in 64-bit mode anyway. Change-Id: Ia8b3b5c641f11e5df05937fe7442be0a223174ef Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Introduce QAtomicInteger<T> and derive QAtomicInt from itThiago Macieira2014-01-302-145/+241
| | | | | | | | | | | | | | | | QAtomicInteger<T> is to QBasicAtomicInteger<T> what QAtomicInt was to QBasicAtomicInt: just a little more syntactic sugar. The Basic classes do not always have a constructor, since they depend on compiler support. The constructor is always present in the non-Basic class, at the expense of making it non-POD for C++98 code. This commit also repurposes most of QAtomicInt's documentation for QAtomicInteger. It adds only the Q_ATOMIC_INTnn_IS_SUPPORTED macro that explains whether the given type is supported on this platform. Change-Id: I58886d6fa49fea4de24015c40dae29c9fa534e00 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-01-203-5/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.h src/corelib/tools/qstring.cpp src/gui/image/image.pri src/gui/image/qimage.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/eglfs/qeglfshooks_stub.cpp tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp Change-Id: I3b9ba029c8f2263b011f204fdf68c3231c6d4ce5
| * Android: Don't register main thread on loading libraryEskil Abrahamsen Blomfeldt2014-01-163-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building with debug, all SLOT or SIGNAL macros will expand to a function call, and then function will call QThreadData::current(), which will set QCoreApplication::theMainThread if it has not already been done. Since Qt Widgets has these macros in the static initialization of the library, we would register the Android main thread as the main thread of Qt, which would mean that the actual application object was created on a different thread than the main thread. This caused warnings to appear, and also triggered a race condition which caused widget applications to sometimes show a black screen instead of content on startup when run with the OpenGL plugin. Task-number: QTBUG-35048 Change-Id: Ie8979f5e7cd5662f8d7dd276de9f94f27cc120b5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | expand tabs and related whitespace fixes in *.{cpp,h,qdoc}Oswald Buddenhagen2014-01-131-3/+3
| | | | | | | | | | | | | | | | the diff -w for this commit is empty. Started-by: Thiago Macieira <thiago.macieira@intel.com> Change-Id: I77bb84e71c63ce75e0709e5b94bee18e3ce6ab9e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | WinRT: Clean up core event dispatcherAndrew Knight2014-01-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Move private classes in the .cpp file (they aren't needed outside) - Conform to Qt style, such as includes and braces - Use ComPtr where appropriate - Use foreach where appropriate - Remove non-functional wake/interrupt leftovers - Remove redundant timer list - Make the timer callback a static method, so it won't crash if it gets called on shutdown Task-number: QTBUG-35945 Change-Id: I5426fba2735e908a04ea60287f9936f5abde6644 Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-12-241-1/+5
|\| | | | | | | Change-Id: I2defae1904154283446b069d151c3ef57302ec7b
| * qthread_win.cpp: Fix warnings when waiting for adopted threads.Friedemann Kleint2013-12-171-1/+5
| | | | | | | | | | | | | | Task-number: QTBUG-35591 Change-Id: I63169bd8a9758a7dad33d4231d3d6c9d71c7e252 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Remove all "old atomic" code from QtThiago Macieira2013-12-104-166/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new atomic code was introduced in Qt 5.0. The platforms that did not get ported were announced as deprecated in Qt 5.2. The code is now removed in Qt 5.3. The status for the platform/compiler/OS combinations affected is: * Linux with GCC or Clang: still compiles on all platforms (via qatomic_cxx11.h or qatomic_gcc.h) * INTEGRITY with Green Hills compiler: no longer compiles * Solaris on UltraSPARC, with Sun Studio: no longer compiles * AIX on POWER5 or 6, with IBM Visual Age: no longer compiles (probably did not compile Qt 5.0 either) * VxWorks in kernel mode: no longer compiles [ChangeLog][General] Support for the following platforms has been removed, due to lack of interest in updating support: INTEGRITY, VxWorks, Solaris on UltraSPARC (with the Sun Studio compiler suite), AIX on POWER processors (with IBM Visual Age compiler suite). Change-Id: I8a961385fd95011c016b2b1eec52034794dae3e1 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Make a nicer output when QBasicAtomicInteger is used with a wrong TThiago Macieira2013-12-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | Before, we'd get just an error message that the size of the array was negative. Now, for C++11 compilers, we get a better error message: qbasicatomic.h:117:5: error: static assertion failed: Template parameter is not a supported integer on this platform qbasicatomic.h:119:24: error: invalid use of incomplete type ‘struct QAtomicOps<long long unsigned int>’ Change-Id: I6b0792254c0dc6103a4a7608f2942d59cda07c00 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Fix silly typo in a macro for QAtomicInt's constructorThiago Macieira2013-12-031-1/+1
| | | | | | | | | | | | | | | | | | The T was missing in QT_BASIC_ATOMIC_HAS_CONSTRUCTORS. This makes QAtomicInt's constructor become constexpr. Change-Id: Ibe58ff36517c5d05ce8af9c0f28169fa63521632 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Set loadAcquire() as const to fix powerpc buildFatih Aşıcı2013-11-291-2/+2
| | | | | | | | | | | | Change-Id: Ica1ea565e7eefd2ef378737eb9687ebbf4adf7b0 Fetched-from: https://bugzilla.redhat.com/attachment.cgi?id=812643 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-11-263-5/+4
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the conflicts in msvc_nmake.cpp the ifdefs are extended since we need to support windows phone in the target branch while it is not there in the current stable branch (as of Qt 5.2). Conflicts: configure qmake/generators/win32/msvc_nmake.cpp src/3rdparty/angle/src/libEGL/Surface.cpp src/angle/src/common/common.pri src/corelib/global/qglobal.h src/corelib/io/qstandardpaths.cpp src/plugins/platforms/qnx/qqnxintegration.cpp src/plugins/platforms/qnx/qqnxscreeneventhandler.h src/plugins/platforms/xcb/qglxintegration.h src/widgets/kernel/win.pri tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp tools/configure/configureapp.cpp Change-Id: I00b579eefebaf61d26ab9b00046d2b5bd5958812
| * Windows: Close handle to thread checking for adopted threads.Friedemann Kleint2013-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-34840 [ChangeLog][QtCore][QThread][Windows][QTBUG-34840] Fix handle leak. Change-Id: I537c1c81a43907f01a81be740746582266969c6f Reviewed-by: Andy Shaw <andy.shaw@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
| * QBasicAtomicInt: fix wrong comment about non-atomic APIDavid Faure2013-11-021-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | The public documentation for load() and store() says it's atomic, and it is: * using _q_value.store(newValue, std::memory_order_relaxed) in the C++11 implementation * using a simple assignment otherwise, which is atomic (and relaxed, no memory barriers) on all the existing C++ ABIs. Change-Id: I40faa47120163225bd11c3a32514ac97ef8bbbd4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Doc: Fix miscellaneous typosSze Howe Koh2013-10-301-1/+1
| | | | | | | | | | | | Change-Id: Iaf0dd8974c3ad78beffa995c596a76fb3e4cceab Reviewed-by: Jerome Pasion <jerome.pasion@digia.com> Reviewed-by: Kurt Pattyn <pattyn.kurt@gmail.com>
* | QThreadPool: fix race at time of thread expiry.David Faure2013-10-312-18/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current synchronization mechanism was racy: decrementing waitingThreads and then hoping that the wakeOne will wake a thread before its expiry timeout happens. In other words, on timeout, a just-assigned task would never run. And then no other task would run, if maxThreadCount is reached. Fixed by using a queue of waiting threads (rather than just a count), and by moving the wait condition into the thread itself, so we know precisely which one we're waking up, and we can remove it from the set of waiting threads before waking it up, and therefore it can determine on wakeup whether it has work to do (caller removed it from the queue) or it expired (it's still in the queue). This is reliable, whereas the return value from QWaitCondition::wait isn't reliable, when the main thread has already decided that this thread has work to do. Task-number: QTBUG-3786 Change-Id: I1eac5d6c309daed7f483ac7a8074297bfda6ee32 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-10-241-14/+15
|\| | | | | | | Change-Id: Ie56539b2e0be611a363b5f15ae5412a78d6945a2
| * Doc: Update, and reduce duplication of, QThread-related infoSze Howe Koh2013-10-211-14/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added/Changed: - Move content from the Thread Basics overview to the QThread class ref - Rephrase bits for clarity - Use more links Removed: - (threads-basics.qdoc) Warning against moveToThread(this): This usage came about when people tried to add slots to a QThread subclass. This patch adds a warning against the root cause. - (threads-basics.qdoc) Note on sleep() et al.: They were made public in Qt 5.0. - (threads-basics.qdoc) The strategy for managing member variables: Sounds error-prone. Pushing results through signals is safer. - (qthread.cpp) The note about GUI classes: Irrelevant to QThread, and it's already mentioned elsewhere. Change-Id: I6bc53cc22b929523f9976d2b920f94c02bd7273e Reviewed-by: Geir Vattekar <geir.vattekar@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-10-1112-98/+123
|\| | | | | | | Change-Id: Ib8cfeee7d9ca15e8ad520e428b72c200827a8628
| * Reorder the members in QThreadData to avoid padding holesThiago Macieira2013-10-082-10/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, this struct had size 104 and a total of 21 padding bytes. Now it's down to 88 bytes and only 5 bytes of padding. pahole report on a 64-bit system: class QAtomicInt _ref; /* 0 4 */ /* XXX 4 bytes hole, try to pack */ public: class QThread * thread; /* 8 8 */ HANDLE threadId; /* 16 8 */ bool quitNow; /* 24 1 */ /* XXX 3 bytes hole, try to pack */ int loopLevel; /* 28 4 */ class QAtomicPointer<QAbstractEventDispatcher> eventDispatcher; /* 32 8 */ class QStack<QEventLoop*> eventLoops; /* 40 8 */ /* --- cacheline 1 boundary (64 bytes) --- */ class QPostEventList postEventList; /* 48 32 */ bool canWait; /* 80 1 */ /* XXX 7 bytes hole, try to pack */ class QVector<void*> tls; /* 88 8 */ bool isAdopted; /* 96 1 */ /* size: 104, cachelines: 2, members: 11 */ /* sum members: 90, holes: 3, sum holes: 14 */ /* padding: 7 */ Change-Id: I1fc88e0b312f38eccdea440734fd37e0519285a2 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
| * Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-0811-89/+89
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Default values should have mark-up to denote that they are code. This commit changes: -"property is true" to "property is \c true". -"Returns true" to "Returns \c true". -"property is false" to "property is \c false". -"returns true" to "returns \c true". -"returns false" to "returns \c false". src/3rdparty and non-documentation instances were ignored. Task-number: QTBUG-33360 Change-Id: Ie87eaa57af947caa1230602b61c5c46292a4cf4e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
| * QObject: use per-thread storage for qFlagLocation()Marc Mutz2013-10-051-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qFlagLocation() uses a global char* array to transport source location information from the connect() side to the metaobject side. The size of the array is 2 (two), which just about suffices for a single connect() statement. Obviously, if more than one thread makes a (_any_) connection at the same time, the data is useless and, worse, there's a data race. The non-reentrancy of qFlagLocations() cannot and need not be fixed, but use a per-thread flagged_locations array in QThreadData so threads don't disturb each other. Task-number: QTBUG-3680 Change-Id: If1797c60751f551694def69afee6fbe295bbe2d2 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | add WinRT event dispatcherOliver Wolff2013-09-261-0/+8
| | | | | | | | | | | | Change-Id: I40b3f896b89b99e271e1a5ca625a5193f4a7f59e Done-with: Kamil Trzcinski Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | threading support for winrtKamil Trzcinski2013-09-265-2/+175
|/ | | | | | Change-Id: Ife296e15ddf727c3f53ab3d3d84634b5c7bbf85c Done-with: Maurice Kalinowski Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QFutureInterface: wrap a pair of {release,reserve}Thread() calls with RAIIMarc Mutz2013-09-211-3/+14
| | | | | | | | | | | | Rationale: a wait on a condition-variable is usually a cancellation point. On Posix, and probably in C++ at some point, a thread cancellation is done by (a kind of) exception unwinding the stack. To ensure that we call reserveThread() in all cases, wrap the function pair in a RAII class. Even if we currently don't seem to support exceptions in QtCore, this is low-hanging fruit, and no worse than what we had before. Change-Id: Ifb0f428ea50f9ac12be14e620615f46e00d3dd91 Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Merge "Merge branch 'stable' into dev" into refs/staging/devSergio Ahumada2013-09-213-5/+4
|\
| * Merge branch 'stable' into devSergio Ahumada2013-09-213-5/+4
| |\ | | | | | | | | | Change-Id: I37d85631ab1165ab91457d8880c4da907a9df73b
| | * Doc: Remove duplicated Qt Concurrent overviewSze Howe Koh2013-09-163-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | - The "Concurrent Programming" page is an exact duplicate of the Qt Concurrent module landing page. - The "qtconcurrent intro" target is not referenced anywhere. Change-Id: Ice9b4360783013fe972258ca54a0004be43b8766 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | | Fix some doc errors.Frederik Gladhorn2013-09-212-2/+2
|/ / | | | | | | | | | | | | Change-Id: Ib874d7e9671d9cee75fe41f4dac5d0de7b09245e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | QMutex: fix race on 'owner' in the recursive caseMarc Mutz2013-09-211-4/+11
| | | | | | | | | | | | | | | | | | | | | | The read from 'owner' for comparison with 'self' in QRecursiveMutexPrivate::lock() is not synchronized with the write to 'owner' in the same function further down, and neither operation is atomic. Fix by making 'owner' an atomic pointer. Change-Id: I186b88575589da0dce5827a1e17ceb4ce599ed02 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | QFutureInterface: remove unused member variable 'pendingResults'Marc Mutz2013-09-202-2/+1
| | | | | | | | | | Change-Id: I059580831ed29a53186272283aa7695c57539eed Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* | Don't use ARMv5/6/7 atomics on 64-bit ARM, as they are AArch32 specificTor Arne Vestbø2013-09-161-3/+3
| | | | | | | | | | Change-Id: I0c359e62a8cbf560691019187f316561bddbee52 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>