summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/thread
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright headersJani Heikkinen2015-02-1121-146/+146
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* QThreadPool::cancel() to remove individual jobs from the job queue.Nick Shaforostoff2014-12-241-0/+51
| | | | | | | | | [ChangeLog][QtCore][QThreadPool] Added QThreadPool::cancel() which allows removing from the job queue a job that hasn't been started yet. Change-Id: Ib8f1c1f32a34f5eec8338c641d820b928e470164 Reviewed-by: Nick Shaforostoff <shafff@ukr.net> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Use the new warning enabling/disabling macros in qtbaseThiago Macieira2014-12-031-7/+3
| | | | | | Change-Id: I91ff06644e8047c2ca483f9768b46c1372eb6171 Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
* tst_QThreadPool: fix memleakMarc Mutz2014-10-191-6/+6
| | | | | | | Benign, but easy to avoid by using the same pattern as in clear(). Change-Id: Ie382313343385f0709519b232a7d58dd8181b8de Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Update license headers and add new license filesMatti Paaso2014-09-2421-398/+230
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* QFutureInterface: allow to work with a QThreadPool != globalInstance()Marc Mutz2014-08-051-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Background: It is often necessary/advisable to schedule tasks on thread pools != globalInstance(). As Herb Sutter writes in http://www.drdobbs.com/parallel/use-thread-pools-correctly-keep-tasks-sh/216500409 and the Qt Training Material stresses, tasks you schedule on a (global) thread pool should be non-blocking, which currently rules out using any of the QtConcurrent functions for, say, file I/O. Nonetheless it's often convenient to have thread pools also for file I/O, as the thumbnail viewer exercise in the Qt Training Material shows. In this case, you'd use a dedicated thead pool, leaving the global thread pool for CPU-bound tasks. Yet, none of the QtConcurrent functions allow to pick the QThreadPool instance on which to schedule the work created with them. This patch prepares for them to do so. This is the first part of the forward-port of https://qt.gitorious.org/qt/qt/merge_requests/1281. Implement by using a new QThreadPool* member that defaults to nullptr, and adding setThreadPool to set this member, then using it in lieu of QThreadPool::globalInstance() everywhere. I chose to leave m_pool == nullptr to mean globalInstance() to avoid creating the global instance whenever a QFuture is created, even if the future represents the result of a calculation not run on the global thread pool. [ChangeLog][QtCore][QFuture] Can now be used with any QThreadPool, not just globalInstance(). Task-number: QTBUG-17220 Change-Id: I4e1dc18d55cf60141b2fa3d14e2d44a3e9e74858 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Merge remote-tracking branch 'origin/5.3' into devFrederik Gladhorn2014-07-031-0/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/accessible/qaccessiblecache_mac.mm src/gui/accessible/qaccessiblecache_p.h src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/widgets/kernel/qwidget_qpa.cpp Manually moved change in qwidget_qpa.cpp to qwidget.cpp (cd07830e3b27da7e96a0a83f91ba08c168b45e62) Change-Id: Ia51f471f9b53de2f3b07d77ea89db9303ac8961d
| * Skip unstable autotests in QtBase.Morten Johan Sørvig2014-07-021-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The combination of these unstable tests makes it very hard to get changes through the CI system due to the unrelated test failures. Skip the following test functions: tst_QIODevice::unget QTBUG-39983 (Mac) tst_QThreadPool:expiryTimeoutRace QTBUG-3786 (Windows) tst_QLocalSocket::processConnection QTBUG-39986 (Mac) tst_QTcpServer::adressReusable QTBUG-39985 (Linux) Change-Id: I96559bea0d437fd25966b6ccac1ece1490e06241 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
* | winrt: Use native threadingAndrew Knight2014-06-251-24/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Updated corelib's unit tests to use QSignalSpy's functor constructorKeith Gardner2014-05-081-19/+19
|/ | | | | | | | | The intent is to provide compile time validation of signals and to help detect signal overloading in the future. Change-Id: I9d5d46ed4b70c5d0cd407deb5928b1e76d37e007 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* Fix tst_qthreadpool under high load.David Faure2014-03-141-0/+1
| | | | | | | | | | The tasks might not have run yet at the time of the QCOMPARE, so we need to acquire on the semaphore in order to ensure that this is the case, just like in the previous testcase. Change-Id: I1da72bb07c2f53760b3bf912fc26aaf10ed18d48 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Remove use of templates in tst_qatomicinteger.Friedemann Kleint2014-03-041-2/+2
| | | | | | | | | | | | | | | | | | | | MSVC 2008 is confused by TypeInStruct being a template, resulting in \tst_qatomicinteger.cpp(189) : error C2027: use of undefined type 'QStaticAssertFailure<Test>' with [ Test=false ] for int (and thus for all unsupported types). This appears to be a real Heisenbug-nature compiler bug as it can also be fixed by adding qDebug() << Q_ALIGNOF(TypeInStruct<T>) before the static assert. Task-number: QTBUG-37195 Change-Id: Ib2b60f3c1ffeb0b8bdeb1fb0c659655ce4ab10d8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add a testAndSet overload to the atomics that returns the current valueThiago Macieira2014-02-163-1/+525
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Replace the type-based QAtomicIntegerTraits with a size-based oneThiago Macieira2014-01-3021-6/+513
| | | | | | | | 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>
* tst_qthreadpool: fix memory leakDavid Faure2013-11-281-1/+2
| | | | | | Task-number: QTBUG-22673 Change-Id: I2e554a2ad0119b5f9ce2d36e4720538af5ef6b82 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-11-261-5/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * Fix test compilation on WinRTAndrew Knight2013-11-261-3/+7
| | | | | | | | | | | | | | | | Tweak a handful of tests which didn't compile on this platform. Change-Id: I208d9eb289dfb226746c6d0163c3ea752485033b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
* | QThreadPool: fix race at time of thread expiry.David Faure2013-10-311-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | Winrt: Skip qthread autotests, which are not supported (yet)Oliver Wolff2013-10-021-0/+12
| | | | | | | | | | | | Change-Id: Ib1047731667ba8a7b9db2f62924eb42a6b85b4fd Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
* | Winrt: tst_qthread: Added QEXPECT_FAIL where neededOliver Wolff2013-10-021-0/+12
| | | | | | | | | | | | Change-Id: I88d98421978e0f5c55af8647f3f74c265b45bd37 Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com>
* | WinRT: Fix various test compilationsAndrew Knight2013-10-022-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | - Remove irrelevant test subdirs via .pro files - Follow WinCE codepaths where applicable - Replace unsupported Win32 APIs with WinRT equivalents This does not aim to fix any failures in the tests themselves; it only makes them compile. Change-Id: Ia82bc0cc402891f8f6238d4c261ee9152b51be80 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* | threading support for winrtKamil Trzcinski2013-09-261-0/+12
|/ | | | | | Change-Id: Ife296e15ddf727c3f53ab3d3d84634b5c7bbf85c Done-with: Maurice Kalinowski Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* tst_QReadWriteLock: replace a volatile bool with an atomic intMarc Mutz2013-09-231-6/+6
| | | | | | | | Fixes the obvious race between the test of 'release' in the thread and the setting of 'release' in the test function. Change-Id: I92df52d7b18e8154f17229a3dbd4a0e58f4a3b5b Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* tst_QMutex: fix a raceMarc Mutz2013-09-231-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code uses a QSignalSpy to check whether the thread started, but the signal emission (and subsequent appending to the spy) and the check for spy.count() before the final thr.wait() are not synchronized: The signal emission happens-after the thr.start() and -before the final thr.wait(). Likewise, the spy.count() happens-after thr.start() and -before thr.wait(), but neither one happens-before the other. Thus, there is a data race. The wait(200) between thr.start() and mutex.unlock() doesn't help, either, because we check only that it doesn't return true, iow, we check that it timed out. But it will happily do that if the thread has not yet started executing, so there's no happens-before relation to be had via that avenue, either. I first fixed by moving the spy.count() check to after thr.wait(). In that case: signal emission happens-before thread finishing happens-before thr.wait() returning happens-before spy.count() so no race. Arguably, that makes the check rather useless, so I decided to remove it completely. Change-Id: I6bb47c4114961ee6e9251cfebeb4b7794ba674a9 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Add an advisory interruption mechanism to QThread.Corentin Jabot2013-09-051-0/+40
| | | | | | | | | | | | | | To ease interruption of long running tasks, a new method QThread::setInterruptionRequested() can be called. The task can check QThread::isInterruptionRequested() and act upon it by stopping itself. These methods are designed to replace the use of a global variable and other hacky ways to stop a task running in another thread. Change-Id: I17622dd60d2262078210e7e4294ad6c53a6dc179 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tst_qthreadpool: fix flaky test I introduced in last commitDavid Faure2013-08-291-0/+4
| | | | | | | | | (dacf9961da86) In order to see 2 active threads, we must check activeThreadCount() before the runnable finishes. Change-Id: I1a48b41e0c1fd81a65d915b9bd1e741ff267ed2b Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QThreadPool: fix counting of waiting threadsDavid Faure2013-08-241-0/+56
| | | | | | | | | | | | | | | | | | QTBUG-21051 has a testcase where activeThreadCount() could actually end up at -1 (converted to an autotest in this commit). The reason was: start() calls tryStart() which returns false due to too many active threads (reserveThread() causes this), so it calls enqueueTask() - which actually wakes up the waiting thread, but it didn't decrement the number of waiting threads. Note that tryStart() is "if I can grab a waiting thread, enqueue task and wake it" while start(), in case tryStart() fails, wants to "enqueue, and then if I can grab a waiting thread, wake it". This is why enqueue shouldn't wake; waking must happen only if we can grab a thread (d->waitingThreads > 0). Task-number: QTBUG-21051 Change-Id: I3d98337103031c9bdf0bf365295f245be0c66aa7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QThreadPool - Add method clear() to remove queued QRunnable.Corentin Jabot2013-08-161-0/+29
| | | | | | | | | | | | | | QThreadPool::clear() method removes all queued QRunnable. When a large number of long-running tasks are queud in a QThreadPool its destruction, which calls waitForDone(), can be quite long. QThreadPool:clear() removes (and deletes when appropriate) all QRunnable that have yet to be started from the queue enabling a faster interruption. Change-Id: Ie5d6028ad3cfe7e439d1db068c8d0936ff818db9 Reviewed-by: David Faure <david.faure@kdab.com>
* Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-05-231-0/+53
|\ | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qdatastream.cpp src/corelib/io/qdatastream.h src/corelib/json/qjsonwriter.cpp src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/xcb/qxcbkeyboard.cpp Change-Id: I46fef1455f5a9f2ce1ec394a3c65881093c51b62
| * QThreadPool: Fix regression from Qt 4 in dealing with priority startsThiago Macieira2013-05-201-0/+53
| | | | | | | | | | | | | | | | | | | | | | | | The optimisation done in cbaf52b09971edf6f3e1458f7dd677b80a1568ed for Qt 5.0 got the order wrong of the comparison. The queue must be sorted in decreasing priority order. But since higher numbers mean higher priority, that means the queue must be sorted in decreasing priority number order. Task-number: QTBUG-29163 Change-Id: Iaf3424b9bb445bf5c71518927f37253cead454f3 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* | Fix some data races in tst_qthreadpool.David Faure2013-05-191-16/+16
|/ | | | | | | Detected by helgrind. Change-Id: I5f73a62610b4bdc7f26629f3dcf7b11467897a5c Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* tst_qthread: fix race on "bool visited"David Faure2013-03-291-4/+4
| | | | | Change-Id: I438bad9a4f8afb76272c8d8f08461a6d2c9a0b18 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Whitespace cleanup: remove trailing whitespaceAxel Waggershauser2013-03-164-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | Remove all trailing whitespace from the following list of files: *.cpp *.h *.conf *.qdoc *.pro *.pri *.mm *.rc *.pl *.qps *.xpm *.txt *README excluding 3rdparty, test-data and auto generated code. Note A): the only non 3rdparty c++-files that still have trailing whitespace after this change are: * src/corelib/codecs/cp949codetbl_p.h * src/corelib/codecs/qjpunicode.cpp * src/corelib/codecs/qbig5codec.cpp * src/corelib/xml/qxmlstream_p.h * src/tools/qdoc/qmlparser/qqmljsgrammar.cpp * src/tools/uic/ui4.cpp * tests/auto/other/qtokenautomaton/tokenizers/* * tests/benchmarks/corelib/tools/qstring/data.cpp * util/lexgen/tokenizer.cpp Note B): in about 30 files some overlapping 'leading tab' and 'TAB character in non-leading whitespace' issues have been fixed to make the sanity bot happy. Plus some general ws-fixes here and there as asked for during review. Change-Id: Ia713113c34d82442d6ce4d93d8b1cf545075d11d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-291-4/+0
| | | | | | | | | | | The macro was made empty in ba3dc5f3b56d1fab6fe37fe7ae08096d7dc68bcb and is no longer necessary or used. Discussed-on: http://lists.qt-project.org/pipermail/development/2013-January/009284.html Change-Id: Id2bb2e2cabde059305d4af5f12593344ba30f001 Reviewed-by: Laszlo Papp <lpapp@kde.org> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
* Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2013-01-2320-20/+20
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-01-2220-20/+20
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qsavefile_p.h src/corelib/tools/qregularexpression.cpp src/gui/util/qvalidator.cpp src/gui/util/qvalidator.h Change-Id: I58fdf0358bd86e2fad5d9ad0556f3d3f1f535825
| | * Update copyright year in Digia's license headersSergio Ahumada2013-01-1820-20/+20
| | | | | | | | | | | | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* | | Check existence of QProcess feature before using it on Qt autotests.Pasi Petäjäjärvi2013-01-231-0/+4
|/ / | | | | | | | | | | | | VxWorks does not have QProcess support. Change-Id: I20ed479125097d468a1aa50afb18c3749f0fbb98 Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
* / Fix crashes in tst_qthreadpool on Windows.Friedemann Kleint2013-01-181-6/+28
|/ | | | | | | | | | | Qt 4.8 shows frequent crashes in runMultiple apparently caused by the QMutex construction in the free functions by different threads. Use a common QMutex class member instead. Change-Id: I851d4e2d3637a7b4f404ed843f5360c10caa21f5 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix QMutex::tryLock with negative valuesThiago Macieira2012-12-231-0/+51
| | | | | | | | | | | | The Linux futex implementation had a Q_ASSERT for positive values, but the documentation says that negative values should be interpreted as infinite (equal to lock()). Test that too. Change-Id: I2f96a502d672732781e88e49797756ca9a809121 Reviewed-by: David Faure (KDE) <faure@kde.org> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix possible crash in tst_QThread::quitLock() testPeter Kümmel2012-12-171-7/+9
| | | | | | | | Don't read member variable of deleted Job object. Change-Id: I71a6565c4932427e9cbab744c2e472b62ea98ca2 Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix QMutex::tryLock timeout computation on LinuxOlivier Goffart2012-11-161-0/+15
| | | | | | | | | | | The timeout is in millisecond. So we just need to divide by 1000 to get the number of seconds Regression introduced in f587e8f4fd670f11fa1e878c1015d7241033559a Reported in the comments of QTBUG-24795 Change-Id: Id16e05e7d04d33605860926f7516d14cdefd6a36 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix for leak in QFutureChristian Strømme2012-11-011-8/+22
| | | | | | | | | | | To avoid leaking when converting a QFuture<T> to a QFuture<void> we need to have a separate ref. counter for QFuture<T>. When the last QFuture<T> goes out of scope, we need to clean out the result data. Task-number: QTBUG-27224 Change-Id: I965a64a11fffbb191ab979cdd030a9aafd4436c2 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* normalise signal/slot signatures [QtCore tests]Marc Mutz2012-10-221-4/+4
| | | | | | | | | | Normalise all signal/slot signatures in tests/*/corelib, except in tst_QObject, where they might be test data. Change-Id: Id4e101f285b1676bb583b0afae06d235e599e24b Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Remove the QThread::terminated() signalSze Howe Koh2012-10-191-2/+2
| | | | | | | | | | | | | | | | | The signal is removed from the API; all references to it are removed from documentation; the unit test that checks for its emission is modified to listen for QThread::finished() instead. The QThreadPrivate::terminated flag is also removed, as it served no purpose other than to trigger the emission of QThread::terminated() As discussed at http://lists.qt-project.org/pipermail/development/2012-October/007216.html the signal is not guaranteed to be emitted after every termination, rendering it useless. Change-Id: I7b0c45d7889da0d33875545331606f2208ee56fc Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Test: remove QSKIP from tst_QThread::stressTestCaroline Chao2012-10-161-3/+6
| | | | | | | Instead omit the whole test when Q_OS_WINCE is defined. Change-Id: Id6f4e65c994115b8bab45f9fbf21dd255d204ea6 Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Move QFutureSynchronizer back to QtCoreMarc Mutz2012-09-283-0/+164
| | | | | | | This class, too, belongs with QFuture. Change-Id: I41a532ca66c156f1631e4b22ffc1a5879c854488 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move QFutureWatcher back to QtCoreMarc Mutz2012-09-284-0/+949
| | | | | | | | This belongs with QFuture. Change-Id: I555cd01c1d3890fbbaca4fd8a9170292ea4eb0fb Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move QFuture from QtConcurrent to QtCoreMarc Mutz2012-09-284-0/+1444
| | | | | | | | | This class belongs to QThreadPool/QRunnable more than to QtConcurrent, so move to QtCore, where QThreadPool awaits it. Change-Id: Ibf20288a986593bf779453427c2dae8db1e1423a Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Move QtConcurrent::ResultStore as QtPrivate::ResultStore to QtCoreMarc Mutz2012-09-283-0/+497
| | | | | | | | | | No compatibility header needed. While this wasn't marked as private API, it wasn't documented, either. This is a prerequisite for moving QFuture to QtCore. Change-Id: I8e986e6e2a22fbe5cf08d0600ec39ae9ae993e20 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>