summaryrefslogtreecommitdiffstats
path: root/src/concurrent/qtconcurrentthreadengine.h
Commit message (Collapse)AuthorAgeFilesLines
* Replace usages of Q_CLANG_QDOC with Q_QDOCLuca Di Sera2022-10-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | To allow the user to customize the C++ code that QDoc sees, so as to be able to work-around some limitations on QDoc itself, QDoc defines two symbols: Q_QDOC and Q_CLANG_QDOC, both of which are "true" during an entire execution of QDoc. At a certain point in time, QDoc allowed the user the choice between a custom C++ parser and a Clang based one. The Q_QDOC symbol would always be defined while the Q_CLANG_QDOC symbol would be defined only when the Clang based parser was chosen. In more recent times, QDoc always uses a Clang based parser, such that both Q_CLANG_QDOC and Q_QDOC are always defined, making them equivalent. To avoid using different symbols, and the possible confusion and fragmentation that derives from it, all usages of Q_CLANG_QDOC are now replaced by the equivalent usages of Q_QDOC. Change-Id: I5810abb9ad1016a4c5bbea99acd03381b8514b3f Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Remove the dead code for blocking methods from QtConcurrentSona Kurazyan2021-06-141-23/+0
| | | | | | | | | | | | | | After 79fd1cb2c631b6084bf10874205d27f5b53c907a the methods for running QtConcurrent algorithms in the blocking mode aren't used anymore. Since ThreadEngineBase and ThreadEngineStarter classes aren't meant to be used externally, it should be fine to remove startBlocking() methods now. Removed the unused code and adjusted the tests accordingly. Change-Id: Ifb13820ce207869d6f720bcb5be8d35bb355fe33 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Remove the unnecessary template parameter from the class specializationSona Kurazyan2021-03-171-2/+2
| | | | | | | | | | | | This seems to cause errors when compiling with gcc-11. Although this is most likely a compiler bug, specifiying the template parameter type in this case isn't necessary. Fixes: QTBUG-91909 Fixes: QTBUG-90568 Pick-to: 6.0 6.1 5.15 Change-Id: Ib231257ccb2e16cc533f23ca5840d31e26a66d53 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Use QList instead of QVector in QtConcurrentJarek Kobus2020-06-221-1/+1
| | | | | | | Task-number: QTBUG-84469 Change-Id: I99e41c1fef5459d7358b20a97a1dbefcd43bb4e5 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Deprecate the pause-related APIs of QFuture* classesSona Kurazyan2020-06-041-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Deprecated the pause-related APIs of QFuture* classes and added alternatives having "suspend" in the name instead. With 2f15927f01ceef0aca490746302a5ea57ea9441c new isSuspended()/suspended() APIs have been added to QFuture* classes for checking if pause/suspension is still in progress or it already took effect. To keep the naming more consistent, renamed: - setPaused() -> setSuspended() - pause() -> suspend() - togglePaused() -> toggleSuspended() - QFutureWatcher::paused() -> QFutureWatcher::suspending() Note that QFuture*::isPaused() now corresponds to (isSuspending() || isSuspended()). [ChangeLog][Deprecation Notice] Deprecated pause-related APIs of QFuture and QFutureWatcher. Added alternatives having "suspend" in the name instead. Change-Id: Ibeb75017a118401d64d18b72fb95d78e28c4661c Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Add a way of notifying QFutureWatcher when pause is in effectSona Kurazyan2020-05-291-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | Because setting QFutureInterface to paused state does not mean that the computations that are already in progress will stop immediately, it may be useful to get notified when pause actually takes effect. Introduced the QFutureWatcher::suspended() signal, to be emitted when there are no more computations in progress, and no more result ready or progress reporting signals will be emitted, i.e. when pause took effect. Added {QFuture, QFutureWatcher}::isSuspended() methods for checking if pause took effect. QtConcurrent will now to send QFutureCallOutEvent::Suspended event when the state is paused and there are no more active threads. [ChangeLog][QtCore][QFutureWatcher] Added a new QFutureWatcher::suspended() signal, to be emitted when pause took effect, meaning that there are no more computations in progress. Added {QFuture, QFutureWatcher}::isSuspended() methods for checking if pause took effect. Fixes: QTBUG-12152 Change-Id: I88f2ad24d800cd6293dec63977d45bd35f9a09f0 Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
* Enable setting custom QThreadPool for QtConcurrent methodsJarek Kobus2020-05-181-1/+3
| | | | | | Task-number: QTBUG-53465 Change-Id: Icff05d5f65dce453ff702502b85c35e20fca86a9 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Get rid of virtual inheritance from ThreadEngineBaseJarek Kobus2020-04-291-1/+1
| | | | | | | | | | | | | | | | | | | | The virtual inheritance causes the issue, when adding new, non-default constructor to the base ThreadEngineBase class. It looks like classes derived from it can't use the non-default constructor, even when it's called explicilty from the subclass. Instead, the default constructor of the ThreadEngineBase class is always required during compilation and called on runtime. In addition, the only sensible use of the virtual inheritance is the multiple inheritance, but apparently it looks like there is no single class in Qt which would multi inherit from the ThreadEngineBase class, so this change shouldn't have any bad side effects. This justifies the current lack of info on why it was introduced originally ages ago. Change-Id: I08266e6f6865d938d1b1e4243ef94d2c02c3a886 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix potential race condition in QtConcurrent blocking methodsSona Kurazyan2020-04-031-0/+1
| | | | | | | | | | | QtConcurrent::blocking*() methods are using the ExceptionStore directly, which is not thread safe. In case if there's an exception thrown from multiple threads there may be a race condition. Added a lock to avoid that. Change-Id: I5de9928f91f5f43951b9bf9c4594694dc0ca0328 Reviewed-by: Vitaly Fanaskov <vitaly.fanaskov@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* QtConcurrent: Unify license headersKai Koehne2019-01-291-1/+1
| | | | | Change-Id: I9492ca18805c9663d48820424557595b8bc7eaa0 Reviewed-by: Jani Heikkinen <jani.heikkinen@qt.io>
* doc: Fix all qdoc errors in QtConcurrentMartin Smith2017-12-081-4/+1
| | | | | | | | | | | | | These errors resulted from the improved parsing provided by clang, which required rethinking which elements of the QtConcurrent API should be visible to clangqdoc. The basic problem is that clang must see declarations for all types used by a type, or else it either gets lost and fails to parse a type correctly, or it simply refuses to include the type in its AST. Change-Id: Iaa699c287e67d1288fcb2d83a9dbbaf07521d0cc Reviewed-by: Martin Smith <martin.smith@qt.io>
* doc: Fix qdoc errors for \fn commands in QtConcurrentMartin Smith2017-12-081-0/+1
| | | | | | | | | | | | | This change updates the \fn commands in the QtConcurrent module, which makes extensive use of templates. Some of the update \fn commands are very long as a result. A few cases of the tag trick were used to fix qdoc errors for some complicated template function signatures that were marked \internal anyway. Change-Id: I8546b89030c51bb9dddf38fa10bc0248d901aa51 Reviewed-by: Martin Smith <martin.smith@qt.io>
* Replace Q_NULLPTR with nullptr where possibleKevin Funk2017-09-191-1/+1
| | | | | | | | | | | | | Remaining uses of Q_NULLPTR are in: src/corelib/global/qcompilerdetection.h (definition and documentation of Q_NULLPTR) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: If6b074d91486e9b784138f4514f5c6d072acda9a Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Replace Q_DECL_OVERRIDE with override where possibleKevin Funk2017-09-191-2/+2
| | | | | | | | | | | | | | | | Remaining uses of Q_DECL_OVERRIDE are in: src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.cpp doc/global/qt-cpp-defines.qdocconf (definition and documentation of Q_DECL_OVERRIDE) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: Ib9b05d829add69e98a86238274b6a1fcb19b49ba Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QtConcurrent: Use Q_NULLPTR instead of 0 in all public headersMarc Mutz2015-11-041-1/+1
| | | | | | | | | | | | This is in preparation of adding -Wzero-as-null-pointer-constant (or similar) to the headers check. Since QtConcurrent is basically all-templates, not all uses of 0 as nullptr might have been detected by the headersclean check. Task-number: QTBUG-45291 Change-Id: Iffcabdbab26b56597700346cd039d0c32c4fddca Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | 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>
* Add Q_DECL_OVERRIDE in the src subdirectoryOlivier Goffart2014-12-031-2/+2
| | | | | | | | | | Done automatically with clang-modernize on linux (But does not add Q_DECL_OVERRIDE to the function that are marked as inline because it a compilation error with MSVC2010) Change-Id: I2196ee26e3e6fe20816834ecea5ea389eeab3171 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Remove QT_{BEGIN,END}_HEADER macro usageSergio Ahumada2013-01-291-2/+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>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Replace macro qdoc with Q_QDOCDebao Zhang2013-01-081-2/+2
| | | | | | | | Both qdoc and Q_QDOC are used in source code, which looks not good. Change-Id: I4f3a71670278b0758d92bfa5db086a07e1b1acfd Reviewed-by: hjk <qthjk@ovi.com> Reviewed-by: Paul Olav Tvete <paul.tvete@digia.com>
* Move QFuture from QtConcurrent to QtCoreMarc Mutz2012-09-281-1/+1
| | | | | | | | | 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::Exception as QException back to QtCoreMarc Mutz2012-09-281-3/+3
| | | | | | | | | Leave the old name as a deprecated typedef; adapt users. This is a prerequisite for moving QFuture back to QtCore. Change-Id: I81dcee2c7e6eb234c16f3f42e2415ca0da3dc4f8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* QtConcurrent: Remove QMutex kept for BC reasons.Morten Johan Sorvig2012-05-301-4/+0
| | | | | | | | | | | Task-number: QTBUG-25052 Since upgrading to Qt 5 forces a recompile there are no longer inline versions of the acquire/release functions in play. Change-Id: I6ce6abe0f16f810891f32c7e8c5c94726e5de873 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Move QtConcurrent configuration to a single fileJoão Abecasis2012-02-141-1/+1
| | | | | | | | | | | | | | This file lives in src/concurrent, alongside the rest of the library. Relevant configuration was moved out of qglobal.h, as it isn't relevant for other parties and thus isn't needed there. This introduces a global header that all QtConcurrent headers now include. This header includes qglobal.h and defines library-specific configuration for all to follow. Change-Id: If6f11e7bbc6139d29004eb1602bd579b75b637c8 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@nokia.com>
* Complete split of QtConcurrent.Friedemann Kleint2012-02-061-1/+1
| | | | | | | | | | - Fix exports. - Fix tests. Acked-by: Thiago Macieira <thiago.macieira@intel.com> Change-Id: I2df923ba74b468f5ee09b3a48ae3d09920751365 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
* Move QtConcurrent into its own moduleLars Knoll2012-02-051-0/+284
Task-number: QTBUG-20892 Change-Id: I614500aafb6428915509983608bbb0ade4e4f016 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>