summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread
Commit message (Collapse)AuthorAgeFilesLines
* QThread: Work around potential crash during objectName accessFabian Kosmale2021-09-232-3/+14
| | | | | | | | | | | | | We access objectName from a different thread than the thread which owns it. This is inherently racy, but was apparently not an issue in practice before. With the new binding system, we however seem to encounter a case where we do run into issues. This patch migitates it by bypassing the binding system (using valueBypassingBindings). Task-number: QTBUG-96718 Pick-to: 6.2 dev Change-Id: I9d8f2354ae282893a32c8a23381d0056ceef7c40 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Fix build on riscv32Fabrice Fontaine2021-09-021-0/+5
| | | | | | | | | | | | | | | | | | | riscv32 fails to build because __NR_futex is not defined on this architecture: In file included from thread/qmutex_linux.cpp:45, from thread/qmutex.cpp:804: thread/qfutex_p.h: In function 'int QtLinuxFutex::_q_futex(int*, int, int, quintptr, int*, int)': thread/qfutex_p.h:116:30: error: '__NR_futex' was not declared in this scope; did you mean '_q_futex'? 116 | int result = syscall(__NR_futex, addr, op | FUTEX_PRIVATE_FLAG, val, val2, addr2, val3); | ^~~~~~~~~~ | _q_futex Fixes: QTBUG-96067 Change-Id: Ib6a9bcc496f37e69ac39362cb0a021fccaf311f5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 035dc537bee26e3b63a211b2835d8560439e161f) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Improve docs for QFuture continuationsSona Kurazyan2021-08-101-43/+47
| | | | | | | | | | | | Replace phrases like "future has been running", "parent" with more precise descriptions. Fixes: QTBUG-95273 Change-Id: Ibd5a464007d41cc437da49ba250b9ea0a46078c6 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit d61820e5ab3176818b8a2326fa25d05a9f135244) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QProperty: Only try to avoid TLS access if currentThreadId is fasterFabian Kosmale2021-08-081-0/+3
| | | | | | | | | | | We will not gain anything if we have to do multiple function calls to obtain the thread id. Therefore we introduce a macro to signal that we have a fast implementation of currentThreadId, and only use the function if it is defined. Change-Id: I3347489ea91992896bb753b796ae26e391c2c99c Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 5889985c8c8e8cc676de4480ad95979287860b96)
* Don't report results when the results list is emptySona Kurazyan2021-07-272-0/+8
| | | | | | | | | | | | | | | | | | | When inserting items into the result store, a ResultItem is created, which stores a pointer to the results list and their size. If the size of the ResultItem is set to 0, it means that a single result is stored. In case of trying to report results via an empty list, the size is 0, so result store treats it as a single result. Added checks before storing the results to make sure that the result list isn't empty. Note that empty lists are allowed in some cases for the filter mode, because ResultStoreBase::addResults() knows how to handle those cases correctly. Task-number: QTBUG-80957 Change-Id: I399af4c3eef6adf82fea5df031fe9a9075006b1f Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 08de1fb28153d8170b592796a84032897afa4206) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Doc: Ensure deprecated APIs in Qt Core are documented as suchNico Vertriest2021-07-232-23/+15
| | | | | | | | | | | Added \deprecated [version_since] when needed Remove references to deprecated functions in \sa statements Fixes: QTBUG-94534 Change-Id: I3b3d4277d63fc5d6d207c28ff2484aed30b83247 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit a2c8184b6b241b063e9af005edf082e653dfd8a6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Make QFutureWatcher::isFinished() consistent with the watched QFutureSona Kurazyan2021-07-232-7/+2
| | | | | | | | | | | | | | | | | | | | | | All the getters of QFutureWatcher are consistent with the getters of the corresponding QFuture, except for the isFinished() method, which returns 'true' only after the finished() signal is delivered. This behavior might be unintuitive for the users. In particular, isFinished() returns 'false', even if it's called immediately after waitForFinished(). [ChangeLog][QtCore][QFutureWatcher][Important Behavior Changes] The QFutureWatcher::isFinished() method now indicates if the related QFuture is finished, instead of indicating if the finished() signal was delivered. This makes it consistent with the future that is being watched. Fixes: QTBUG-91048 Change-Id: I6ae9b882b23e06198a82c95b026491bd480b3bf0 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> (cherry picked from commit 53e4a50c6b3c7359b9afc24f30c9517abdf9561a) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* Put Q_DISABLE_COPY(QMutex) back when features.thread is unavailableTasuku Suzuki2021-06-301-0/+3
| | | | | | | | | | | Revert a part of d3638e18d396f1935804908da717ca5cb97f2eda because the change was not needed Task-number: QTBUG-94407 Change-Id: I7cf0969d6ecc4078d38b4241ffe7d24273a6d412 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> (cherry picked from commit ab6bccdd8121c773883794fe86d0a157d1f9d4d6) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QFutureInterface: remove the inconsistent and unneeded includeSona Kurazyan2021-06-251-1/+0
| | | | | | | | | | QMutexLocker is declared in qmutex.h, which is already included. Task-number: QTBUG-94407 Change-Id: I78e0630c27ef7f85feae68e98f8cdcbe4e142cd8 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> (cherry picked from commit a527fbf1797fca1a2f764bca85551562be460bb0) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QOrderedMutexLocker: Disable copy and provide explicit dismiss functionFabian Kosmale2021-06-171-0/+37
| | | | | | | | | | | | | | | | Copying a QOrderedMutexLocker is questionable, and would currenly easily lead to UB. Therefore we delete the copy ctor and copy assignment operator, and implement well-behaving move operators. In addition, provide an explicit dismiss method for cases where we don't want the locker to unlock the mutexes, as they have been manually unlocked (this could have been implemented previoulsy by using the copy assignment operator). Change-Id: If2a888710e1c74277b28fd3e2939ab26fff0c7ae Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> (cherry picked from commit 7fefce73284de4204d64c7e4129f39004a13cdad) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
* QPromise: doc fixesGiuseppe D'Angelo2021-06-081-1/+1
| | | | | | | | Add a noexcept from a doc signature that was missing it. Change-Id: I30b429a6ec4d182551ca68767d1c8aa61c9e4c09 Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* QFutureInterface(Base): code tidiesGiuseppe D'Angelo2021-06-082-5/+6
| | | | | | | | | | | | | | | | refT()/derefT() can be marked noexcept; we don't care about not overflowing the refcounter as a precondition. (This is BC, as no compiler mangles noexcept.) This in turn allows to mark a constructor calling refT() as noexcept. Driveby: mark also the same functions to not be `const` in Qt 7. They clearly are meant to modify *this, and constness only works because of the unmanaged (raw) d-pointer. Change-Id: I8d7d365640ff2e1cedc0a234c9abccdfc95ba6e3 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* QPromise/QFutureInterface: in Qt 7 take std::exception_ptr by const-refGiuseppe D'Angelo2021-06-084-0/+19
| | | | | | | | | | | std::exception_ptr is a reference-counted "smart pointer", so we shouldn't copy it around freely. Unfortunately QFutureInterface has exported functions taking it by value, so we can't just change the signatures and keep BC. Simply prepare the code for Qt 7. Change-Id: Ic5aae6a095c8c842872a40db440c99d2dfe371f1 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* QFuture: remove incorrect sentence from docsGiuseppe D'Angelo2021-05-271-3/+0
| | | | | | | | | QFuture shouldn't be passed by value: it's a reference counted class ("shared future"). Change-Id: I3890062c45f9a6470b278223b88d482f57bf68a0 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* Doc: Use \deprecated instead of \obsoletePaul Wicking2021-05-262-9/+9
| | | | | | Task-number: QTBUG-93990 Change-Id: I4e512354a49dde6678ca89cabc56bc76ba666bb3 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* QPromise: code tidiesGiuseppe D'Angelo2021-05-221-1/+1
| | | | | | | | | | Get rid of a reduntant initialization; a data member gets default initialized anyways. Change-Id: I85ad4c9a00b3066ccd993dfc2652a3f0164a860e Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io>
* QPromise/QFuture: fix value semanticsGiuseppe D'Angelo2021-05-224-28/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In random order: * QFutureInterfaceBase has a d-pointer, and copy semantics. So, "naturally" extend it to support move semantics as well. (These get used by QPromise/QFuture, as they both hold a QFutureInterface* as a data member). The only addition needed is a check for a null d-pointer in the destructor. Drive by, reorganize the code for the copies, and use copy-and-swap instead of the hand-rolled solution. Also, add a free swap() overload, and mark the existing one as candidate for inlining in Qt 7 (doesn't need to be an exported function). * QFutureInterface inherits QFutureInterfaceBase, again with value semantics. To be honest, I'm not sure why QFutureInterfaceBase is polymorphic -- could be a design mistake, as polymorphic classes don't mix with value semantics. Anyways, reorganize the code for copies, apply copy-and-swap, and add move semantics. This requires adding a check into derefT(). * Finally, QPromise was already move-only, but had broken move semantics: the move constructor was not noexcept (!) and it actually allocated memory (!!!). Fix that one (can be defaulted now), and streamline the move assignment via the proper macro. Drive by, fix the signature of the constructor from QFutureInterface (take const-ref, not plain ref -- it's eventually copied, so it can keep the const), and add another internal constructor from rvalue QFutureInterface that moves from it. Change-Id: I9d61a9dd4d45f34942d8f34416baa118c0307390 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* QFuture/QPromise: don't check for is_copy_constructibleGiuseppe D'Angelo2021-05-212-6/+4
| | | | | | | | | | | | | The check is over-arching. is_move_constructible is sufficient; we don't have to support "ridiculous" types that are copiable but have deleted move operations (such types are fundamentally broken). This is in line with the Move* (legacy) named requirements. Change-Id: Idc7116b39013501b9be39628a4e7afd35fe15530 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* Avoid mixing atomic futex changes and QAtomicAllan Sandfeld Jensen2021-05-191-28/+16
| | | | | | | | | | | | Either the mix of futex and atomic, or the mix of 32-bit futex and 64-bit atomic doesn't work. In any case, the existing code leads to bad behavior. Pick-to: 6.1 5.15 Fixes: QTBUG-92188 Change-Id: Icc6ba28d6e2465c373d00e84f4da2b92c037e797 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Make the exit() methods in QEventLoop and QThread be slotsThiago Macieira2021-05-171-2/+1
| | | | | | | | | | | | | | | The documentation for QCoreApplication::exit() even refers to it as such. Instead of refactoring the documentation to explain that it isn't, just make it a slot and do the same for the other classes. Complements 2e6c37fe51b5f6073db0c7335c4a4272269d482f. [ChangeLog][QtCore][QEventLoop] exit() is now a slot, like quit(). [ChangeLog][QtCore][QThread] exit() is now a slot, like quit(). Change-Id: Ic42004c9bf71440eb433fffd167f4a1b89bcac80 Reviewed-by: David Faure <david.faure@kdab.com>
* Remove the broken qToVoidFuture() functionSona Kurazyan2021-05-101-6/+0
| | | | | | | | | | QFuture already has a constructor from QFuture<T> to QFuture<void>. It's safe to remove this function, since it couldn't be ever used: it tries to access QFuture's private member, which leads to compilation error. It was never documented or tested. Change-Id: Iaed9602e2737455d159012ea18ca241954e1f7df Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* QThreadPool: obey the docs that say we always use at least 1 threadThiago Macieira2021-04-242-8/+13
| | | | | | | | | | | | | | Even if the user (usually accidentally) sets a thread count of zero or negative. The reporter in the bug report did QThread::idealThreadCount() - 1 on a 1 CPU system... Drive-by add to the documentation and the missing #include. Pick-to: 6.1 6.0 Fixes: QTBUG-93007 Change-Id: I6cdea00671e8479b9c50fffd167807d14e030154 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Do not access internal allThreads data unlockedAllan Sandfeld Jensen2021-04-231-0/+1
| | | | | | | Pick-to: 6.1 6.0 5.15 Change-Id: I54eb67571fff07ffdbf9d2b77c96bb85e3fae5e0 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix build without features.threadTasuku Suzuki2021-04-151-4/+1
| | | | | Change-Id: I233808be77dbf1930ebf65b6f23298414eab1da7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Light cleanup in QSemaphore Futex implementationAllan Sandfeld Jensen2021-04-131-35/+27
| | | | | | | | Gets rid of a goto, fixes overflow detection with wakeAll set, and fixes 64-bit futex mode with futexHasWaiterCount = false. Change-Id: I8bb98118013fc1dc2a8a405845bec0cb3350494f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix qdoc warning, it's QThread::PriorityVolker Hilsheimer2021-04-121-1/+1
| | | | | Change-Id: If3df55ff95f8bdb510bdc3578ba3c7c03b9029a1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtFuture::connect: disconnect signals firstMårten Nordheim2021-04-121-7/+7
| | | | | | | | | | During reportFinished we may call a continuation which might end up triggering one of the signals. Pick-to: 6.0 6.1 Change-Id: I19546fcca12be71cd536e4287eb5eddd9d236830 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Fix futexNeedsWake() on 64-bit systemsAllan Sandfeld Jensen2021-04-091-4/+5
| | | | | | | | | It was mistaking semaphore values over 0 as waiters, regardless of actual waiters. Pick-to: 6.1 Change-Id: Icebd01592ca8bdc1687a29dc569e3b630a262606 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSemaphore: fix missed wakes with futex on WindowsMårten Nordheim2021-04-071-6/+13
| | | | | | | | | | | | | | | | | | | We do this by making the 'futexNeedsWakeAllBit' to be part of both the expectedValue and the pointer we're waiting on. This makes sense since having the 'futexNeedsWakeAllBit' set is a requirement for starting a sleep. Thus we should condition sleeping on whether or not another thread unset it. Since the futexNeedsWakeAllBit is in the "topmost" bit of the pointer we wait on we'll need to use the full 64-bits on 64-bit platforms. This isn't enabled (nor was it an issue) for configurations with 'futexHasWaiterCount' since that works differently, and waits for the high 32 bits. Fixes: QTBUG-92148 Change-Id: I424c605f0120ea5e647c5bb19b00ff35eaf1608a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSemaphore: move suspect increment of waiter countMårten Nordheim2021-04-061-3/+3
| | | | | | | We might return false a few lines down, without decreasing the count. Change-Id: I0a90c07f279860987e41539e9d5f3b5d2cb15207 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QThreadPool: let the started thread have the same name as the poolThiago Macieira2021-04-031-1/+7
| | | | | | | | | | If the pool has a name. This should make identifying threads belonging to different pools easier in process-inspection tools. Fixes: QTBUG-92004 Change-Id: Id2983978ad544ff79911fffd167225902efeb855 Reviewed-by: Samuel Gaist <samuel.gaist@idiap.ch> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Add support to set thread priority to QThreadPoolSamuel Gaist2021-04-033-2/+33
| | | | | | | | | | | | | | | | | | Currently, QThreadPool's generated threads inherit the priority from the thread they are created and that cannot be changed. This merge request adds a property to QThreadPool so that the priority of the threads can be different. The default behavior does not change. [ChangeLog][QtCore][QThreadPool] QThreadPool can now be configured to use a different thread priority when creating new threads than the one it inherits from the thread it was created in. This will only apply to the threads started after the property is changed. Fixes: QTBUG-3481 Change-Id: Ic98d4312d055a3357771abb656516ebd0715918d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QGenericAtomicOps: allow pointer-sized non-atomic atomicsThiago Macieira2021-04-021-2/+4
| | | | | Change-Id: Id2983978ad544ff79911fffd1671f696b8a9ca35 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Provide an inline implementation of currentThreadId() on WindowsLars Knoll2021-03-231-0/+25
| | | | | | | | | | | | | As this method is rather critical for performance of some central parts of Qt, it really should be inline whereever possible. This commit adds an inline implementation for Windows 32 and 64 bit. Amends 5e9b2ade678f37e43bfc2e3484f54cbbb5844d2e Change-Id: Iea51ef905b1cb7f91ca64b718d79bdc4f5c02c3a Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge integration refs/builds/qtci/dev/1616415197Qt CI Bot2021-03-222-19/+18
|\
| * QFutureInterfaceBasePrivate: reorder members to save 8 bytesFabian Kosmale2021-03-222-19/+18
| | | | | | | | | | | | | | | | And use in-class member initialization where applicable. Task-number: QTBUG-92045 Change-Id: I54715709f2d8e54017311f45016c16d86ed3078b Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* | QFuture: cleanup headersFabian Kosmale2021-03-224-14/+25
|/ | | | | | | | | | | | | | Do not include vector; we currently do not use std::vector, and the plan is to use QList when that one supports move-only types. Use QMutexLocker instead of std::mutex_locker, considering that the former is already included with <QMutex>. Use forward declarations where applicable. Add header which were currently only indirectly included (to make QtCreator's code model happy). Change-Id: I37d5cd3982047a6d8a3132fd66571878298039b3 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io> Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
* Mention QPromise in the QFuture docsSona Kurazyan2021-03-161-3/+4
| | | | | | Pick-to: 6.1 6.0 Change-Id: I5f6930116da534dd1dea41c4724c42104de38877 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* Futex/Windows: add support for notifying TSanThiago Macieira2021-03-111-22/+24
| | | | | | | | | The code was already there, just only implemented for Linux. Change-Id: Ib709fc1585f647a98d54fffd16663881b6d24d6f Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Improve docs for QFuture::then() with contextSona Kurazyan2021-02-251-0/+10
| | | | | | | | | | | | | Be more precise about attaching a continuation with the default (QtFuture::Launch::Sync) launch policy after a continuation with context. Pick-to: 6.1 Change-Id: I5b80063df2443e5742033864ba012bf34ed4cdf7 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Doc: Fix qdoc warnings in qtbaseNico Vertriest2021-02-181-1/+1
| | | | | | | Task-number: QTBUG-90662 Change-Id: I894ed70ca8514cfb0afc7e547c7fe3efadcaad50 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Implement futexes for WindowsThiago Macieira2021-02-134-195/+150
| | | | | | | | | | | | | Windows 8 added this pair of functions that can be used to implement the same functionality as we have on Linux. For ease of understanding, I'm calling them "futex" on Windows too. From Qt 6 our minimum platform is Windows 10 so we can use this unconditionally. Change-Id: Ifea6e497f11a461db432ffff1448c6806ecfc36c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Revert "Port QThreadPool to the new property system"Allan Sandfeld Jensen2021-01-293-42/+17
| | | | | | | | | | This reverts commit 8f8405e04642b98663d4752d4ae76c304ae33b01. Reason for revert: Appears not entirely thread-safe and caused QTBUG-90705 Change-Id: I390c0b1a555a18e6a095b52010371d017071e26b Fixes: QTBUG-90705 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* Port QThreadPool to the new property systemSona Kurazyan2021-01-273-17/+42
| | | | | | | | | | | Ported all properties, except activeThreadCount. Marking it dirty may cause a re-evaluation of properties depending on it, which may reault in a deadlock in case of trying to read activeThreadCount property which is being marked as dirty. Task-number: QTBUG-85520 Change-Id: Id073b0895c89a9e6b05b57ad520db994e550a1c9 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
* Update QMutexLocker documentationLars Knoll2021-01-261-1/+1
| | | | | | | | | And add an entry about the API changes to qt6-changed.qdoc. Pick-to: 6.0 Task-number: QTBUG-89429 Change-Id: I146574acd3e4aa5ed6f1629fc68888f009472f19 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove the qmake project filesJoerg Bornemann2021-01-071-83/+0
| | | | | | | | | | | | | | | | Remove the qmake project files for most of Qt. Leave the qmake project files for examples, because we still test those in the CI to ensure qmake does not regress. Also leave the qmake project files for utils and other minor parts that lack CMake project files. Task-number: QTBUG-88742 Change-Id: I6cdf059e6204816f617f9624f3ea9822703f73cc Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* Doc: Use correct include for QtFuture namespacePaul Wicking2021-01-061-0/+1
| | | | | | | Pick-to: 6.0 Fixes: QTBUG-89766 Change-Id: I20c5d3c12490a5eed7bb4e267b2edb5d45dbaadf Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Call QEventDispatcher::startingUp() on thread startMorten Johan Sørvig2020-12-213-1/+2
| | | | | | | | | | | | | | | | ...instead of during createEventDispatcher(). This way, startingUp() will be called [on the thread being started] also for custom event dispatchers installed with QThread::setEventDispatcher(). This prevents crashes when installing event dispatches which expects that startingUp() will be called. Crash reproducible with test case from QTBUG-51961. Change-Id: I71bd696539689d928a61ff9b47d05297cf803b2f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add support of invoking QFuture continuations in a given contextSona Kurazyan2020-12-113-20/+211
| | | | | | | | | | | | Added overloads of .then()/.onFailed()/.onCanceled() which take a pointer of a context object, and invoke the continuations in the object's thread. Task-number: QTBUG-86794 Change-Id: I0f3cbb0500695673fc4087af5d4b96b416e3e1ce Reviewed-by: Andrei Golubev <andrei.golubev@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* Remove unneeded qatomic_msvc.hChristian Ehrlicher2020-12-043-491/+0
| | | | | | | | | Since Q_COMPILER_ATOMICS is defined for every supportied MSVC compiler in qcompilerdetection.h, qatomic_msvc.h is not included anymore in qbasicatomic.h and can be removed. Change-Id: I6505da5d5e9f1c3f9a060ad30cabb4b652634aa3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>