summaryrefslogtreecommitdiffstats
path: root/src/corelib/concurrent
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright headersAkseli Salovaara2015-03-3137-481/+481
| | | | | | | | | 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. Change-Id: I7e3e96183e073877b46bc8071b2ccae19e69426b Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
* Updated year in copyright headerKai Koehne2014-03-2637-37/+37
| | | | | | | | | | | | | | | | | | find . -path '*/3rdparty/*' -prune -o -type f -print | xargs -L1 sed -i -E 's/Copyright(.*) 2013 Digia/Copyright\1 2014 Digia/g' Manually patched files: demos/spectrum/3rdparty/fftreal/fftreal_wrapper.h demos/spectrum/3rdparty/fftreal/fftreal_wrapper.cpp src/3rdparty/s60/eiksoftkeyimage.h tools/qdoc3/test/qt-project.qdocconf tests/auto/qsharedpointer/nontracked.h tests/auto/qsharedpointer/nontracked.cpp Change-Id: I3f9074923b4d6bd4666258ab04f01476cc6e901c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Sergio Ahumada <sahumada@blackberry.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QThreadPool: fix race at time of thread expiry.David Faure2013-11-152-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 Backport from qtbase/a9b6a78e54670a70b96c122b10ad7bd64d166514 Change-Id: Ic766ff67dea7a8bb8f1bc893943060ee5428d782 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QThreadPool: fix counting of waiting threadsDavid Faure2013-11-151-2/+8
| | | | | | | | | | | | | | | | | | | | 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 Backport from qtbase/dacf9961da86751a59da0e84bc943fe0d1c8d95b Change-Id: I1e437da27b733a72b48ff1b6f2b78f81a7ed129b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QThreadPool: fix data races in activeThreadCount()David Faure2013-11-151-5/+3
| | | | | | | | | | | | | | | | | | | | Rather than trying to make it lock-free (which requires double-bookkeeping of 4 atomic ints!), just lock the mutex before calling it. tst_bench_qthreadpool shows no difference whatsoever between the two solutions, I get 0.005 msecs per iteration in startRunnables(). Of course looping over calls to activeThreadCount() is a bit slower, from 0.0002 msecs per iteration to 0.00027 msecs, i.e. 35% more. But polling activeThreadCount() from the app is a really wrong thing to do anyway, this benchmark was just for my own curiosity about the price of a mutex in a function that sums up 4 ints. What matters is start() performance, which is unchanged (0.00007 msecs is just noise compared to a 0.005 total, that's 1.4%). Backport from qtbase/85b24bb2dea97c3a9b013bacd5a422b26fe5d14b Change-Id: Id32791069bc1e2dd61cef708d5287c9f9b7e5582 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QThreadPool: fix typosDavid Faure2013-11-151-12/+14
| | | | | | | | Task-number: QTBUG-31919 Backport from qtbase/37dc44d499884bd0d7ab9d2f1547db468c9fe53b Change-Id: I9496b059ed201da6b7a5ec02c4acb8f231e40c30 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove unnecessary typedef, found by GCC 4.8Thiago Macieira2013-04-101-1/+0
| | | | | | | | | qtconcurrentfilter.h:108:47: warning: typedef 'Iterator' locally defined but not used [-Wunused-local-typedefs] Qt5 commit: d4c241a98059edaa7a4b15beb1cfd16ed041284e (qtbase) Task-number: QTBUG-30594 Change-Id: Icc69e41c2d4e11962f0c8434236d4847b46e7d9d Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix compilation of Qt Concurrent with gcc 4.3Thiago Macieira2013-02-271-1/+1
| | | | | | | | | | | | GCC 4.3 had support for decltype but not the new function syntax (which we call "auto function" for short). That meant the code did not compile. qtconcurrentrun.h:105: error: expected initializer before ‘->’ token Task-number: QTBUG-28984 Change-Id: I792276ec59c4f6e73f6137c517636e70c71ed849 (cherry-picked from Qt 5 commit 0c4f6c6ea9415bcc5fde3e34bf909f43a9c6483c) Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-1337-37/+37
| | | | | | Change-Id: I52bf8ef0447b701b4ebf7d7d240013a72adb9425 Reviewed-by: Akseli Salovaara <akseli.salovaara@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Revert "QtConcurrent: Fix for leak in QFuture"Thiago Macieira2012-11-193-46/+5
| | | | | | | | | | This reverts commit 28b06b3ebae3d411c74f09fa7de52bc290c47dc3 That commit contains new symbols added in a patch release of Qt. That is not permitted. Change-Id: I1d36b50d4c26aa32072fd3f9c311a0e773527abd Reviewed-by: Christian Stromme <christian.stromme@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QtConcurrent: Fix for leak in QFutureOrgad Shaneh2012-11-083-5/+46
| | | | | | | | | | | | | 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. backported from qt/qtbase commit 731ba8ed08f80644b403556638c7f6229e678ebe Original commit by Christian Strømme Task-number: QTBUG-27224 Change-Id: I0c6b525cf241b5c559a1bab4e0066cd4de556ea8 Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* Fix for memory leak in ResultStoreOrgad Shaneh2012-11-081-1/+4
| | | | | | | | | | | | | | | In ResultStoreBase::addResults() it possible that the ResultItem we create is invalid (filter-mode enabled). Since an invalid ResultItem won't have any result data, we need to make sure that we don't allocate any data for it. Backported (with minor technical changes) from qt/qtbase commit 6039179373f7552c2a711b06a7d69b9ca9d2b175 Original commit by Christian Strømme Task-number: QTBUG-27224 Change-Id: I5c941363c211d0414d461e7b1b0274c80f3d69b9 Reviewed-by: Christian Stromme <christian.stromme@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-2937-888/+888
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: I280c0a575987d1770e354b4948f1d4d767d711ea Reviewed-by: Simo Fält <simo.falt@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Update contact information in license headers.Sergio Ahumada2012-08-0137-74/+74
| | | | | | | | | | | | | - Replace Nokia contact email address with Qt Project website. - Remove "All rights reserved" line from license headers. As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: Ie7ba62011752fcb149b99b26317c54f2a0cfa931 Reviewed-by: Jason McDonald <jason.mcdonald@nokia.com>
* Update year in Nokia copyright messages.Jason McDonald2012-01-1137-37/+37
| | | | | | | | | Simple search and replace. This commit doesn't touch 3rd-party files, nor translations (where the change is not so simple and will be handled in a separate commit). Change-Id: I4e48513b8078a44a8cd272326685b25338890148 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Fix compile issue when building with QT_NO_CONCURRENT and QT_NO_FUTUREAndy Shaw2011-09-191-0/+3
| | | | | | | | | | This solves a build issue on Solaris as the symbols were missing so they are now added in the expected way after discussion with the Nokia developer who approved the patch originally for winscw. Task-number: QTBUG-21523 Merge-request: 1389 Reviewed-by: ossi
* Wrap calls to Sequence::push_backJoão Abecasis2011-09-023-15/+32
| | | | | | | | | | | | | | | | | In C++11 push_back is overloaded to support rvalue-references, void std::vector<T>::push_back(const T &); void std::vector<T>::push_back(T &&); so attempting to get the address for push_back is ambiguous. Instead of hardcoding the function signature, the better and more general solution is to allow the compiler to do the required overload resolution itself, also allowing for implicit conversions to take place. Task-number: QTBUG-18996 Done-with: Liang Qi Reviewed-by: Olivier Goffart
* Merge remote-tracking branch 'origin/4.8'Olivier Goffart2011-05-2437-629/+629
|\
| * Update licenseheader text in source files for qt4.8Jyri Tahtela2011-05-1337-629/+629
| | | | | | | | | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* | Support of lambdas in QtConcurrent::runOlivier Goffart2011-05-194-81/+124
|/ | | | Reviewed-by: Joao
* Disable QtConcurrent for Symbian winscw builds.Laszlo Agocs2011-05-122-5/+22
| | | | | | | | | | | | | | | | | While QtConcurrent is nowadays usable with RVCT and GCCE compilers, the compiler used for the winscw target has problems with the templates still. To enable building 4.8 on winscw, the patch defines QT_NO_CONCURRENT and QT_NO_QFUTURE in qglobal.h for this target. However this causes further complications in the Q_OBJECT classes of QtConcurrent because moc will be run without having QT_NO_CONCURRENT and QFUTURE defined (as moc is not a Symbian app and for other Symbian targets they must not be defined, which makes differentiation in qglobal.h impossible for the moc run) and having a moc file generated for a class that will be ifdef'ed out during compilation causes build breaks. Therefore additional dummy stubs are provided in QFutureWatcherBase. Reviewed-by: Liang Qi
* Get rid of "typename, typename" for TEMPLATE_TEMPLATE_PARAMETERS.Liang Qi2011-05-021-18/+0
| | | | Because Qt doesn't support that feature before.
* Compile with msvcOlivier Goffart2011-05-021-4/+16
| | | | msvc tries to instenties the return type of overloads that are not chosen by overload resolution
* compile with windowsOlivier Goffart2011-05-021-4/+4
| | | | MSVC doesn't pick up the right template partial specialisation.
* get rid of the DisableIfSame hackOlivier Goffart2011-05-022-16/+4
| | | | By changing the order of the parametters, in a way it is unlikely to clash
* Rewrite the interfaces of QtConcurrent.Liang Qi2011-05-023-1057/+270
| | | | | | | | | At least make RVCT 2.2 work. Task-number: QTBUG-5182 Task-number: QTBUG-9070 Reviewed-by: Olivier Goffart Reviewed-by: joao
* Merge branch 'master' of scm.dev.nokia.troll.no:qt/qt into earth-masteraxis2011-04-071-1/+1
|\ | | | | | | | | Conflicts: src/corelib/thread/qthread_unix.cpp
| * Merge remote-tracking branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2011-03-311-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: doc/src/declarative/example-slideswitch.qdoc doc/src/development/qmake-manual.qdoc doc/src/snippets/code/doc_src_qmake-manual.pro doc/src/snippets/code/doc_src_qtscript.qdoc src/corelib/animation/qabstractanimation.cpp src/s60installs/bwins/QtOpenGLu.def src/s60installs/eabi/QtOpenGLu.def src/s60installs/eabi/QtOpenVGu.def tests/auto/qdir/qdir.pro tests/auto/qsslsocket/tst_qsslsocket.cpp tools/qdoc3/doc/qdoc-manual.qdocconf
| | * Report that an update is needed if no update was doneThiago Macieira2011-03-281-1/+1
| | |
* | | QtConcurrent: throw exception from destructorOlivier Goffart2011-03-281-6/+1
|/ / | | | | | | | | Task-number: QTBUG-18149 Reviewed-by: Morten Sorvig
* | Merge remote-tracking branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2011-02-232-7/+7
|\ \ | |/ | | | | | | | | | | | | Conflicts: src/gui/kernel/qcocoaview_mac.mm src/s60installs/bwins/QtGuiu.def src/s60installs/eabi/QtGuiu.def src/testlib/qtestcase.cpp
| * Use QElapsedTimer in QFutureInterface.Thiago Macieira2011-02-162-7/+7
| | | | | | | | | | | | | | | | QElapsedTimer can also keep its on vlaid/invalid state, so we don't need to keep an additional boolean. Task-number: https://projects.maemo.org/bugzilla/show_bug.cgi?id=227660 Reviewed-by: Morten Sørvig
* | Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2011-01-1737-37/+37
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/webkit/imageanalyzer/imageanalyzer.h examples/webkit/imageanalyzer/mainwindow.h mkspecs/unsupported/qws/linux-x86-openkode-g++/qplatformdefs.h src/corelib/io/qfsfileengine_iterator_unix.cpp src/corelib/io/qfsfileengine_iterator_win.cpp src/corelib/kernel/qcoreapplication.cpp src/network/access/qnetworkaccessdatabackend.cpp src/plugins/bearer/connman/qconnmanservice_linux.cpp src/plugins/platforms/openvglite/qwindowsurface_vglite.h src/s60installs/bwins/QtCoreu.def src/s60installs/eabi/QtCoreu.def src/s60installs/s60installs.pro tools/assistant/tools/assistant/helpviewer_qwv.h tools/qdoc3/test/qt-html-templates.qdocconf
| * Update copyright year to 2011.Jason McDonald2011-01-1037-37/+37
| | | | | | | | Reviewed-by: Trust Me
* | Remove qDebug.Morten Johan Sørvig2010-11-111-1/+0
| |
* | Support exception handling in QtConcurrent::run()Morten Johan Sørvig2010-11-111-2/+24
| | | | | | | | Use QFutureInterface::reportException() in the same way that we do in QtConcurrent::map().
* | QThreadPool: name pooled threadsArvid Ephraim Picciani2010-09-171-0/+1
| | | | | | | | | | | | Task-Number: QTBUG-13702 Reviewed-by: Andy Shaw Reviewed-by: ossi
* | Merge branch 'qt-master-from-4.7' of ↵Qt Continuous Integration System2010-08-251-1/+1
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | scm.dev.nokia.troll.no:qt/qt-integration into master-integration * 'qt-master-from-4.7' of scm.dev.nokia.troll.no:qt/qt-integration: (168 commits) Remove enums from bitfield, since all compilers do not support them. Don't circumvent onDestruction handlers when clearing expression in delegate cleanup Fix responseText to check the charset encoding field and also to not Re-insert and emit the correct NOTIFY signals following the removal Fix poor flicking behavior with slower flicks. Alignment of shadow for rich text is broken when using text styles typo Setting one dimension of the sourceSize should set the other dimension. Document calling QObject methods from QML in Extending QML in C++ docs. Stabilize tst_qgraphicsscene QDeclarativeDebug: send a message when new object are added QDeclarativeEngineDebugServer: make it a singleton. Fixed compile error in runonphone. Fix mispositioned text with QStaticText and OpenVG graphics system Use binarysort to find items. Use QImage 'convertInPlace' versions in QVGPixmapData load functions. QGraphicsView: Fix assert that may occurs if there are 'empty' item to draw, and changed() signal connected Added an install target to runonphone. Fix tst_Collections::QTBUG13079_collectionInsideCollection Fix few declarative code issues discovered by static code analysis ...
| * \ Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2010-08-251-1/+1
| |\ \ | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/win32/msbuild_objectmodel.cpp src/declarative/qml/qdeclarativexmlhttprequest.cpp src/opengl/opengl.pro src/opengl/qgl_p.h src/plugins/bearer/connman/qconnmanservice_linux.cpp tests/auto/qpainter/tst_qpainter.cpp tools/assistant/tools/assistant/helpviewer_qwv.h tools/assistant/tools/assistant/openpageswidget.h
| | * Doc: QtConcurrent::run. Make sure the example actually compilesOlivier Goffart2010-08-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QString::split has overload, and if you want to take the address of a function with overload, you need to cast it. If we really wanted to use QString::split, we would have to do QFuture<QStringList> future = QtConcurrent::run(string, static_cast<QStringList (QString::*)(const QString &, QString::SplitBehavior, Qt::CaseSensitivity ) const>(&QString::split), QString (", "), QString::KeepEmptyParts, Qt::CaseSensitive); So use QByteArray::split as an example instead Task-number: QTBUG-12897 Reviewed-by: David Boddie
* | | QFutureWatcher: display a warning when connecting after calling setFuture()Olivier Goffart2010-08-231-0/+9
|/ / | | | | | | Reviewed-by: brad
* | Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2010-08-134-4/+4
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/painting/qpainter.cpp src/gui/text/qtextengine.cpp tests/auto/qimage/tst_qimage.cpp tests/auto/qpainter/tst_qpainter.cpp tools/qdoc3/test/assistant.qdocconf tools/qdoc3/test/designer.qdocconf tools/qdoc3/test/linguist.qdocconf tools/qdoc3/test/qmake.qdocconf tools/qdoc3/test/qt-build-docs.qdocconf tools/qdoc3/test/qt-html-templates.qdocconf tools/qdoc3/test/qt-html-templates_zh_CN.qdocconf tools/qdoc3/test/qt.qdocconf
| * Correcting spelling mistakes in documentation. Part of fix for QTBUG-11938.Jerome Pasion2010-08-093-3/+3
| | | | | | | | | | Reviewer: David Boddie Task number: QTBUG-11938
| * Fixed spelling mistakes in documented functions, classes, etc. Part of ↵Jerome Pasion2010-07-291-1/+1
| | | | | | | | QTBUG-11938 and QTBUG-10801
* | It is no longer necessary to check for QT_NO_MEMBER_TEMPLATESminiak2010-08-031-1/+1
| | | | | | | | | | Merge-request: 756 Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
* | It is no longer necessary to check for QT_NO_PARTIAL_TEMPLATE_SPECIALIZATIONminiak2010-08-031-4/+1
| | | | | | | | | | Merge-request: 756 Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
* | Remove obsolete code & workarounds for unsupported versions of MS Visual C++miniak2010-08-031-6/+0
| | | | | | | | | | | | | | The minimum supported version of MS Visual C++ 2003, which is _MSC_VER 1310. Merge-request: 756 Reviewed-by: Olivier Goffart <olivier.goffart@nokia.com>
* | Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2010-07-281-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/kernel/qapplication.cpp tests/auto/qfileinfo/tst_qfileinfo.cpp tools/qdoc3/test/assistant.qdocconf tools/qdoc3/test/designer.qdocconf tools/qdoc3/test/linguist.qdocconf tools/qdoc3/test/qmake.qdocconf tools/qdoc3/test/qt-build-docs.qdocconf tools/qdoc3/test/qt.qdocconf
| * Merge remote branch 'origin/4.6' into qt-4.7-from-4.6Thiago Macieira2010-07-151-1/+1
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bin/syncqt src/3rdparty/webkit/VERSION src/3rdparty/webkit/WebCore/ChangeLog src/3rdparty/webkit/WebCore/bridge/qt/qt_instance.cpp src/3rdparty/webkit/WebCore/bridge/qt/qt_runtime.h src/3rdparty/webkit/WebCore/page/FrameView.cpp src/3rdparty/webkit/WebCore/page/FrameView.h src/3rdparty/webkit/WebCore/platform/ScrollView.cpp src/3rdparty/webkit/WebCore/platform/ScrollView.h src/corelib/plugin/quuid.cpp src/gui/dialogs/qfontdialog.cpp src/multimedia/audio/qaudiodevicefactory.cpp src/opengl/qgl.cpp src/openvg/qpaintengine_vg.cpp tests/auto/qxmlquery/tst_qxmlquery.cpp
| | * typos fixedJoerg Bornemann2010-07-071-1/+1
| | | | | | | | | | | | Reviewed-by: TrustMe