summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread
Commit message (Collapse)AuthorAgeFilesLines
* QMutexPool: fix memory order of atomic operationsMarc Mutz2019-08-052-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | The array of QAtomicPointer<QMutex> can be initialized using relaxed stores of nullptr, since nullptr is the whole data. But once we store an actual QMutex pointer in the array, we need to publish the indirect data thus created. We did this, with testAndSetRelease(); what was missing was a corresponding acquire fence on load, without which there is no happens-before relationship between the writes performed by the QMutex ctor and the reads performed by a subsequent mutex.lock(), say, on the same data. Fix by adding acquire fences to all loads. That includes the dtor, since mutexes may have been created in different threads, and never been imported into this_thread before the dtor is running. As a drive-by, return a new'ed QMutex that was successfully installed directly to the caller, without again going through a load-acquire. Fixes: QTBUG-59164 Change-Id: Ia25d205b1127c8c4de0979cef997d1a88123c5c3 Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> (cherry picked from commit 65b8f59e045bb41fef99b1a44f462115de65064a) (cherry picked from commit da38f0d691d9d7eacfac5fbcbd47b887bd59bd39)
* Fix race condition on qt_create_tls() on WindowsThiago Macieira2019-08-051-0/+2
| | | | | | | | | | | | | | | | | If this function is called by multiple threads, more than one could reach the mutex locking and call TlsAlloc(), but only the last one would save the data. The others would be leaked and, worse, be used by those other threads. [ChangeLog][QtCore][QObject] Fixed a resource leak caused by a race condition if multiple QObjects were created at the same time, for the first time in an application, from multiple threads (implies threads not started with QThread). Fixes: QTBUG-77238 Change-Id: Ife213d861bb14c1787e1fffd15b63a5818bcc807 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Merge "Merge remote-tracking branch 'origin/5.12.4' into 5.12"Qt Forward Merge Bot2019-06-171-0/+6
|\
| * Add names for pthreads in IntegrityJanne Koskinen2019-06-031-0/+6
| | | | | | | | | | | | | | | | Set name for pthread instead of "name too long" for easier tracking. Change-Id: Iab22cbeac01277e4dc1325399c7892de2e5bd551 Reviewed-by: Timo Aarnipuro <timo.aarnipuro@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Doc: Correct documentation of QFuture::cancelPaul Wicking2019-06-112-9/+9
|/ | | | | | | | Fixes: QTBUG-76305 Change-Id: I192a7f0bc2c15e532bc6d51c7e9c39561ae3436c Reviewed-by: Topi Reiniö <topi.reinio@qt.io> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* Fix recursive includeAllan Sandfeld Jensen2019-04-041-1/+1
| | | | | | | | | | | qatomic.h included qbasicatomic.h which included qatomic.h. Due to a define in qbasicatomic.h, the definitions from QAtomic would change depending on which was included first. Fortunately qbasicatomic does not need qatomic.h so the include can be removed. Change-Id: I086009f2e16a6e20b2b76fc6b3bf66a343414206 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Use the \nullptr macro instead of 0Venugopal Shivashankar2019-04-021-1/+1
| | | | | | | | This enables overriding the macro so that it translates to 'None' in the Qt for Python context. Change-Id: Ib3cecf57eeb0405a1929309b71e9f012a07f11cf Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* nothread: add exit function to QThread stubLorn Potter2019-03-041-0/+10
| | | | | | | This allows QtDeclarative examples to build. Change-Id: Icd20304f76f8ba15c94eaf01b9fcd7b151b16146 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Fix QDeadlineTimer::Forever case in QWaitConditionMorten Johan Sørvig2019-02-081-1/+3
| | | | | | | | | | | | | The timeout will never be larger than numeric_limits<quint64>::max(), especially on platforms with 32-bit longs. Instead, test if the timeout is exactly numeric_limits<unsigned long>::max(), which matches the ULONG_MAX value which is documented to indicate no timeout. Change-Id: Ib663eddb5703797c50c04fd4eae60bd64f379d1c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* Doc: update docs for the sleeping functions' accuracyThiago Macieira2018-12-071-0/+24
| | | | | | | | And take the opportunity to tell people not to sleep. It's always wrong. Fixes: QTBUG-71757 Change-Id: I36203b7dac414e3eb9effffd1566b956dd05f32a Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.12.0' into 5.12Liang Qi2018-11-161-6/+3
|\ | | | | | | Change-Id: Ic1dd39044e19f50e1068d4ac70dacaad6440e570
| * Correctly document value of QThread::currentThreadId on WindowsVolker Hilsheimer2018-11-061-6/+3
| | | | | | | | | | | | | | | | | | | | The implementation calls GetCurrentThreadId, not GetCurrentThread, so the return value is not the pseudo-handle. Task-number: QTBUG-67686 Change-Id: Ifde0cf603dcea01bc1c454a8bebe1e5c0f22617f Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Make QThreadPool::waitForDone more atomicAllan Sandfeld Jensen2018-11-122-41/+44
| | | | | | | | | | | | | | | | | | | | Avoid having the reset in waitForDone interfere with other uses of the thread-pool by locking the mutex higher, and maintaining the state so the queues doesn't have threads not in allThreads. Task-number: QTBUG-62865 Change-Id: I17ee95d5f0e138ec15e785c6d61bb0fe064d3659 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | winrt: Use SwitchToThread instead of Sleep(0)Oliver Wolff2018-10-311-4/+0
|/ | | | | | | | | | | UWP also supports SwitchToThread. The usage of Sleep(0) was a leftover that was forgotten when porting to desktop Window's approach of handling threads. Change-Id: I5e3d6fb3eefe07407b910cc6a6b45781d320e151 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* qreadwritelock: Fix Q_ASSERT typoMikhail Svetkin2018-10-171-2/+2
| | | | | | | Task-number: QTBUG-71156 Change-Id: Idc249b8b499106c3683a7fd641f27d22047386fe Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Doc: Move literal code block to a separate fileCristian Maureira-Fredes2018-10-151-25/+4
| | | | | | | | | | | We need to override this snippet for the documentation we generate for Qt for Python, and it is easier to have it on a separate file. Task-number: PYSIDE-801 Task-number: PYSIDE-691 Change-Id: Ideb5b6af25024279f167137d3b65660bb9c96a7e Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* winrt: Explicitly set main thread in QCoreApplication's constructorOliver Wolff2018-10-082-2/+36
| | | | | | | | | | | | | | | For winrt we cannot rely on the fact, that QThread::current will be called from the correct thread for the first time. The application's main entry point creates a suspended thread and starts it right afterwards. At that moment, other functionality (QLoggingRegistry for example) might have called QThread::current, which set the wrong thread as the main thread. In order to avoid this situation, the main thread is explicitly set in QCoreApplication's constructor. Task-number: QTBUG-66418 Change-Id: I8b6347357a80eb395ae758bd3d420adef0826751 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* Merge remote-tracking branch 'origin/5.11' into 5.12Liang Qi2018-09-271-3/+5
|\ | | | | | | | | | | | | | | Conflicts: src/corelib/global/qconfig-bootstrapped.h src/widgets/util/qcompleter.cpp Change-Id: I4f44f0f074982530f2f2e750ce696230b2754cf3
| * Clarify docs regarding the states of a QFutureWatcher with no future setAndy Shaw2018-09-241-3/+5
| | | | | | | | | | | | Task-number: QTBUG-55554 Change-Id: I49b475a95d8ee65864cfa6d1024cb17cfe648b43 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | Fix erroneous use of errno with qErrnoWarningThiago Macieira2018-09-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | On Windows, the error code to be used with qErrnoWarning is not errno, but Windows's GetLastError(). Obviously, right? So don't pass errno to it, just let it get the error message straight from qt_error_string(), which will use GetLastError(). Change-Id: I44e7d800c68141bdaae0fffd155619c93e3f3dab Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | No-thread: prevent double delete of QThreadPrivateMorten Johan Sørvig2018-09-251-0/+1
| | | | | | | | | | | | Change-Id: Ie34c06ad798be6bd91f5c356051daaa72800c20a Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Windows code: Fix to prefer ranged-for, as clang-tidy advisesFriedemann Kleint2018-09-021-4/+2
| | | | | | | | | | | | | | Change-Id: Id9bb21855ae832cdbbc456326226ec72b634672e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Luca Beldi <v.ronin@yahoo.it> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Windows code: Fix clang-tidy warnings about else after jumpsFriedemann Kleint2018-09-021-22/+18
| | | | | | | | | | | | | | | | | | Replace by switch() where appropriate, remove else and unindent code or simplify the return value. Change-Id: Ie988b9068a9579ae5a899b3765e43aad480b564e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Windows code: Fix clang-tidy warnings about C-style castsFriedemann Kleint2018-08-301-4/+6
| | | | | | | | | | | | | | | | | | | | | | Replace by reinterpret_cast or const_cast, respectively. Use auto when initializing a variable to fix Clang warnings about repeating the type name, do minor tidying along the way, and a few conversions of 0 or NULL to nullptr. Change-Id: Ieb271a87ddcf064f536e1ff05d23b1e688b1b56a Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | qthreadstorage.h: Fix syncqt warning about include path for qscopedpointer.hFriedemann Kleint2018-08-241-1/+1
| | | | | | | | | | | | | | | | | | | | Add QtCore, fixing: qthreadstorage.h includes qscopedpointer.h when it should include QtCore/qscopedpointer.h Amends 815153d4a453855bb528f0fa9cb7e5a77d589a11. Change-Id: I8424bc4d0b0d666dbd04d63530af4fbd27987628 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | Merge QThread class definitionsMorten Johan Sørvig2018-08-173-31/+70
| | | | | | | | | | | | | | | | | | We can reuse the main QThread definition for the no-thread configuration and avoid having to keep them in sync. Add stub definitions for member functions where needed. Change-Id: I128db11684a6040d09c4a4ce114f1399cba523f8 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* | Modernize the "thread" featureUlf Hermann2018-08-1726-149/+105
| | | | | | | | | | | | | | | | | | | | Add it to configure.json and replace all occurrences of QT_NO_THREAD with QT_CONFIG(thread). Add conditions for other features that depend on thread support. Remove conditions where we can use the QMutex and QThreadStorage stubs. Change-Id: I284e5d794fda9a4c6f4a1ab29e55aa686272a0eb Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | Add QThreadStorage stub implementationMorten Johan Sørvig2018-08-171-0/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | Add implementation for the no-thread configuration: Assume access will only happen from one thread and use a QScopedPointer to hold the data. Unlike the real implementation this version will delete the stored data on destruction, as opposed to on QApplication destruction. Change-Id: I9d8e89e7da18f967f463e2db7b50549c962acc84 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* | Correctly initialize adopted threads in stub implementationMorten Johan Sørvig2018-08-171-0/+2
| | | | | | | | | | | | | | | | | | Set data->threadId, which makes the thread detection used by Qt::AutoConnection work: it will now actually select Qt::DirectConnection. Change-Id: I9369e47eb7ed3ec88dba25f2d41e92139958bcd7 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
* | QThread: Centralize the creation of the event dispatcherThiago Macieira2018-07-144-15/+19
| | | | | | | | | | | | | | | | | | | | | | In some places we call startingUp(), in others we don't. It's probably ok for those that have just created an object of a given class, which knows whether the virtual call is necessary or not. But for the generic case, we do call it. Change-Id: If48c5c2e920c433298f1fffd153ee1cc75703204 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QFutureInterface::reportFinished use nullptr instead of 0Albert Astals Cid2018-07-051-1/+1
| | | | | | | | | | | | | | | | So that users don't get a warning if using -Wzero-as-null-pointer-constant Change-Id: Ia15b5f380a2f6a93e05eec06646608e480cdf5d2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-07-023-43/+19
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qnsview.mm src/plugins/platforms/cocoa/qnsview_dragging.mm src/plugins/platforms/ios/qiosinputcontext.mm src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/tools/androiddeployqt/main.cpp Was moved from qttools into qtbase in 5.11. So re-apply 32398e4d here. tests/auto/corelib/global/qlogging/test/test.pro tests/auto/corelib/global/qlogging/tst_qlogging.cpp tests/auto/corelib/io/qfile/tst_qfile.cpp tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp tests/auto/corelib/thread/qthreadstorage/test/test.pro tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp tests/auto/widgets/kernel/qapplication/test/test.pro Done-with: Gatis Paeglis <gatis.paeglis@qt.io> Done-with: Mårten Nordheim <marten.nordheim@qt.io> Done-with: Oliver Wolff <oliver.wolff@qt.io> Change-Id: Id970486c5315a1718c540f00deb2633533e8fc7b
| * Replace LGPL licenses in .qdoc files with FDLKai Koehne2018-06-282-42/+18
| | | | | | | | | | | | | | | | .qdoc files should only be licensed under FDL (for documentation) or BSD (if they only contain code). Change-Id: I2a8a5b2c7bd3f927b8f71506c3672bc4916aca1e Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
| * Doc: Add missing full stops in briefsPaul Wicking2018-06-211-1/+1
| | | | | | | | | | | | Task-number: QTBUG-68933 Change-Id: I3f2a9f8c562f9a44bb32bddd31d75abbfe6de04d Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | Make the stub implementation of QThread compile againUlf Hermann2018-06-223-10/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We cannot inline methods of QThreadPrivate because QThreadData has to be declared before. The global QThreadData needs to be accessible to QThreadData::clearCurrentThreadData(), and QAdoptedThread::run() has to be moved inside the #ifndef QT_NO_THREAD block as run() doesn't exist in the stub and Q_DECL_OVERRIDE would be wrong. We also fix the QThreadData::current() method to take and use the same parameters as in the non-stub case. Change-Id: Id29ca44b11fa95ed2df7cc39243a07ce7d3c455e Reviewed-by: Ulf Hermann <ulf.hermann@qt.io> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | Make the sleep methods available in QThread even if QT_NO_THREADUlf Hermann2018-06-223-2/+16
| | | | | | | | | | | | | | | | | | sleep, msleep, and usleep are not actually related to threading and serve a purpose also in a single threaded application. Change-Id: Iba2e343d48a9c09e60125bc1b589047e0241608a Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-06-074-9/+511
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/corelib/kernel/qeventdispatcher_cf.mm src/gui/kernel/qguiapplication_p.h src/gui/kernel/qwindowsysteminterface.cpp src/gui/kernel/qwindowsysteminterface.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/cocoa/qnswindowdelegate.mm src/plugins/platforms/ios/qioseventdispatcher.mm src/plugins/platforms/windows/qwindowsdrag.h src/plugins/platforms/windows/qwindowsinternalmimedata.h src/plugins/platforms/windows/qwindowsmime.cpp src/plugins/platforms/winrt/qwinrtscreen.cpp Change-Id: Ic817f265c2386e83839d2bb9ef7419cb29705246
| * Doc: Add information about QThread own methods thread affinitySamuel Gaist2018-06-031-8/+11
| | | | | | | | | | | | | | | | | | | | This patch improves the documentation regarding the thread affinity of QThread's own methods. It's not always clear for people new to threading that a QThread object lives in the old thread were it was instantiated and that calling the methods of said objects will also happen there. Change-Id: I3599851ebc97a33602ca6499da254a08aec59b2b Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
| * Revert "Atomics: remove qatomic_msvc.h"Kai Koehne2018-06-013-1/+500
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 90493e16b8dd9edc6176d0abc255422edbbb05c3. The change broke static builds with MSVC. [ChangeLog][Visual Studio] Reverted a change that caused static binaries compiled with Visual Studio 2015 to crash on start-up. Note that this does not apply to Visual Studio 2017 static binaries, even though the crash stack traces are very similar: with 2017, the problem is compiler regression and requires updating to version 15.8 for the fix. Task-number: QTBUG-68514 Change-Id: I67ea8e1ef442cecab83e7d8d74efc9617e02da35 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Fix warning about tautological comparison in 32-bit modeThiago Macieira2018-06-011-1/+1
| | | | | | | | | | | | | | | | | | qwaitcondition_unix.cpp:209:14: error: comparison of constant 9223372036854775807 with expression of type 'unsigned long' is always false Task-number: QTBUG-68568 Change-Id: Icc2c231dc2c44abdb087fffd1533c70ae68060dd Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | Fix include style in qreadwritelock_p.hJoerg Bornemann2018-04-251-1/+1
| | | | | | | | | | | | | | ...to make that file bootstrap-compatible. Change-Id: Ic7c3b64cb27f3fd81f0140b6ee899310fa04f4c7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-04-101-3/+7
|\| | | | | | | Change-Id: I0120f804522c0c652e9537b6e9fe08189f071ed2
| * QSemaphore: Fix 64-bit Linux QSemaphores initialized to non-zeroThiago Macieira2018-04-061-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original design for the 64-bit futex had the token count replicated in the high part. But the constructor wasn't setting it. This is one of the issues I had noticed when investigating QTBUG-66875, but didn't need to address since the the fix I ended up applying in commit 081c001deb75fa38385d3ff8cbbdb4f788529133 made that unnecessary: the high part only had the number of waiters. Unfortunately, when commit f502270c0f06daba75c1da381bd1658d81aa7bba brought back the token count in the high part, I failed to correct that problem. As a consequence, every QSemaphore that was initialized in the constructor to a non-zero value would eventually deadlock. This commit fixes that oversight. Task-number: QTBUG-67481 Change-Id: I662b8f168c74440ab1a8fffd1522be6b85adb4d0 Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Svenn-Arne Dragly <svenn-arne.dragly@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-03-311-13/+20
|\| | | | | | | Change-Id: I33b47095efdfe0ba698c6a88ca41ec911f432208
| * QSemaphore: attempt to fix again the 64-bit Linux semaphoreThiago Macieira2018-03-291-13/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This time, the issue was that we could race a wait and a wake. A multi- token waiter would not notice that the number of tokens changed because it only performed a fetch-and-OR, then waited on the high part which did not change. That means the futex_wait() would succeed, when we wanted it to have failed. So we have to bring back a portion of what commit 081c001deb75fa38385d3ff8cbbdb4f788529133 removed: we need to keep both the token count and the waiter count in the high word. Task-number: QTBUG-67214 Change-Id: I04a43ee94975482f9e32fffd151e467a9e0030b3 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-03-301-1/+1
|\| | | | | | | Change-Id: If9cc79a7cc098104333821bc3b345f6890f01825
| * QFutureWatcher: Refer to convenience method resultAt in documentationKari Oikarinen2018-03-281-1/+1
| | | | | | | | | | | | | | | | | | The future does not actually have a result() member function that takes an int. The correct function is resultAt(). But that is also available directly in the QFutureWatcher, so refer to that instead of advising to get to the future. Change-Id: I53d267b4b48b1171bf611e11130b9dacabc059a4 Reviewed-by: Martin Smith <martin.smith@qt.io>
* | Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-03-216-57/+674
|\| | | | | | | Change-Id: I35a6555e3885e489f88aa9b4b0142e1017f7a959
| * QSemaphore: add minor optimization for 64-bit Linux systemsThiago Macieira2018-03-191-0/+7
| | | | | | | | | | | | | | | | Since we won't use the high bit of the low 32-bit word at all, we don't need the AND with 0x7fffffff either. Just cast. Change-Id: I72f5230ad59948f784eafffd151aa5a7dee995db Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * QSemaphore: fix deadlock when the woken up thread wakes up anotherThiago Macieira2018-03-191-43/+88
| | | | | | | | | | | | | | | | | | | | | | | | When the thread that got woken up by release() is supposed to release() to wake up another thread, we were deadlocking. This happened because we cleared the bit indicating that there was contention when the first release(). Instead of storing a single bit, we now store the number of threads waiting. Task-number: QTBUG-66875 Change-Id: I72f5230ad59948f784eafffd15193873502ecba4 Reviewed-by: Lars Knoll <lars.knoll@qt.io>