summaryrefslogtreecommitdiffstats
path: root/src/corelib/thread/qbasicatomic.h
Commit message (Collapse)AuthorAgeFilesLines
* Revert "QAtomic: remove the copy ctor and assignment operator"Volker Hilsheimer2023-10-251-2/+2
| | | | | | | | | | | This reverts commit 6a93ec2435b8a453d43956fef6afa5f091d70ffc. Reason for revert: Breaks qtdeclarative build, submodules need to be clean before we deprecate or remove APIs. Change-Id: Id0726b9bfad6072065b380b44b6ff6dffda79e45 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QAtomic: remove the copy ctor and assignment operatorGiuseppe D'Angelo2023-10-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These special member functions have no purpose. We never *documented* their semantics. Any code using them is unconditionally wrong (which semantics was it assuming?), so we can accept the SIC (type A). If a user needs such a copy, they would have to reason on the intended semantics (relaxed? acquire/release?) and be explicit in their code. Especially for assignment, they would need understand the consequences of the memory ordering that apply on _each_ atomic object involved and not on the assignment operation as a whole (there are no such semantics). Testing this change on qtbase has already found bugs. From a purely technical point of view: we don't guarantee lock-free atomics nor we require them from the underlying platform. An atomic is therefore allowed to be implemented as a mutex protecting a value, and mutexes are not copiable. std::atomic follows the exactly same pattern (not copiable nor copy-assignable) for exactly the same reasons, and Qt atomics are implemented on top of std:: ones. [ChangeLog][QtCore] The copy constructor and assignment operators of Qt atomic classes (QAtomicInteger, QAtomicPointer) have been removed. Their usage in user code should be considered a programming error, as no memory ordering semantics were ever documented for these operations (and therefore relying on any specific semantic would be relying on undocumented, unportable behavior). This matches the API of the std::atomic class in C++. Note that you can still use explicit load/store operations to transfer a value across two Qt atomic objects, and therefore use the memory ordering specified for the load/store operations. Change-Id: Iab653bad761afb8b3e3b6a967ece7b28713aa944 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QBasicAtomicXXX: remove the comment about them being "New atomics"Thiago Macieira2023-07-081-2/+0
| | | | | | | | | | | | | They were new... in commit 1f843ca39ee59c5304009faf308ddce791614a02 ("Add the new QBasicAtomicXXX implementation - no backends yet") for Qt 5.0, which is what allowed us to use the C++11 atomics. That replaced the even older implementation from Qt 4.4 where QBasicAtomicInt was a full class and we didn't support any other integer types. That of course replaced the even older QBasicAtomic from 4.0, first introduced in 2004 (7 years before C++11). Change-Id: I53335f845a1345299031fffd176fa251b31bfeea Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* Break qglobal.h cyclic includes [3/3]Ahmad Samir2023-05-261-2/+0
| | | | | | | | | | | | | | ... with q*atomic.h. Drive-by change: include <climits> instead of <limits.h>, from the former's docs: «This is a Standard C++ Library file. You should @c \#include this file in your programs, rather than any of the @a *.h implementation files.» Task-number: QTBUG-106722 Change-Id: Id8169c482d2231c1620db033fbed1f904e15ed9c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTypeInfo: start moving away from isIntegral / isPointerGiuseppe D'Angelo2022-12-271-1/+1
| | | | | | | | | They offer no value over the traits in the standard library (in fact, they're implemented precisely in terms of those traits). This commit is done in preparation for their removal. Change-Id: I3fb67e03e1c476f6ac0b369dfbbcf46b291270c8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Q(Basic)Atomic: remove QT_BASIC_ATOMIC_HAS_CONSTRUCTORSFabian Kosmale2022-09-281-6/+0
| | | | | | | | | The define has always been set, so we can simplify all the code that checked for it. Change-Id: I9133ba95dbd6e1da465ade1d1306310bd3fb9a45 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Get rid of bootstrapped atomicsFabian Kosmale2022-09-281-13/+1
| | | | | | | | | C++11 atomics should be available everywhere, even it bootstrapped builds. This will allow further simplificattions. Task-number: QTBUG-103847 Change-Id: Ic8aaec5667ef7616a6aa1f0dfc2f64d327308501 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use SPDX license identifiersLucie Gérard2022-05-161-39/+3
| | | | | | | | | | | | | 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 unneeded qatomic_msvc.hChristian Ehrlicher2020-12-041-4/+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>
* Get rid of Q_COMPILER_CONSTEXPR checksAllan Sandfeld Jensen2020-11-171-11/+2
| | | | | | | Is required now. Change-Id: I62e95929d1649ea1390392230b619bd56d2a0349 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Replace Qt CONSTEXPR defines with constexprAllan Sandfeld Jensen2020-08-141-14/+14
| | | | | | | | Both normal and relaxed constexpr are required by our new minimum of C++17. Change-Id: Ic028b88a2e7a6cb7d5925f3133b9d54859a81744 Reviewed-by: Sona Kurazyan <sona.kurazyan@qt.io>
* QAtomic*: purge deprecated load() and save() methodsEdward Welbourne2020-08-141-11/+2
| | | | | | | | Deprecated in 5.14 in favor of loadRelaxed() and storeRelaxed(). Caught one surviving use of load() in the ios platform plugin. Change-Id: I9518064a948e5d26ccb956490cbb0561bed5d8b5 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Port Q_STATIC_ASSERT(_X) to static_assertGiuseppe D'Angelo2020-06-191-2/+2
| | | | | | | | | | | | | | | | | There is no reason for keep using our macro now that we have C++17. The macro itself is left in for the moment being, as well as its detection logic, because it's needed for C code (not everything supports C11 yet). A few more cleanups will arrive in the next few patches. Note that this is a mere search/replace; some places were using double braces to work around the presence of commas in a macro, no attempt has been done to fix those. tst_qglobal had just some minor changes to keep testing the macro. Change-Id: I1c1c397d9f3e63db3338842bf350c9069ea57639 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* INTEGRITY: remove constexpr supportGiuseppe D'Angelo2019-11-291-3/+3
| | | | | | | | | | It doesn't seem to be working correctly with array of literal types, blocking the patch refactoring the webgradient support: 10171: "painting/webgradients.cpp", line 79: error #28: expression must have a constant value Change-Id: I9ddd768d24ef79dd7a69e23c91988d891e41d4b9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Revert "Revert "Deprecate QAtomic::load() / store()""Giuseppe D'Angelo2019-09-161-4/+8
| | | | | | | | | | This reverts commit 5859f7d0d9440f82086486639a707f3935696cf4. Reason for revert: the blocker for qtdeclarative has been merged (in qtdeclarative/c060f6e765a2f155b38158f2ed73eac4aad37e02). Change-Id: Ie69cb1567417173f543e88f659658fe03ba28830 Reviewed-by: Liang Qi <liang.qi@qt.io>
* Revert "Deprecate QAtomic::load() / store()"Liang Qi2019-06-261-8/+4
| | | | | | | | | | | | | | | | | | | This reverts commit 79bdc7cf1daec75df59de9236599a9f24077511a. We haven't ported every usages to loadRelaxed() / storeRelaxed() yet. And warning as error is enabled in dev. We will revert this change when new qt5 baseline got integrated. Task-number: QTBUG-76611 Change-Id: I5b1f608fefbaca481311f376f22718f2c5047106 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* Deprecate QAtomic::load() / store()Giuseppe D'Angelo2019-06-101-4/+8
| | | | | | | | | | | | | | | | Tell people to move to loadRelaxed() / storeRelaxed(), now that we have them. [ChangeLog][QtCore][QAtomicInteger] The load() / store() functions have been deprecated in favor of loadRelaxed() / storeRelaxed(). [ChangeLog][QtCore][QAtomicPointer] The load() / store() functions have been deprecated in favor of loadRelaxed() / storeRelaxed(). Change-Id: If7a31db2f90fce4a7605a2377067e86990646f48 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QAtomic: introduce loadRelaxed() / storeRelaxed()Giuseppe D'Angelo2019-06-101-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Plain load() / store() have already relaxed semantics. This can be surprising -- std::atomic::load()/store() are actually sequentially consistent -- and introduce a pain point if someone wants to move from Qt atomics to std:: atomics. So just add a suffix to the functions to clarify what's the memory ordering involved with them. The Ops::load / ::store are temporarily left in, because other modules depends on them. We need to port those modules away, then they can go (it's private API anyhow). Similarly, not deprecating anything yet, except for marking obsolete in the docs; there's a lot of code around using load() / store() that needs to be ported first. [ChangeLog][QtCore][QAtomicInteger] Added loadRelaxed() and storeRelaxed(), to be used as replacements of load() / store(). [ChangeLog][QtCore][QAtomicPointer] Added loadRelaxed() and storeRelaxed(), to be used as replacements of load() / store(). Change-Id: Iab0a78885050379e3740f0b039ba2bef28ce3bd2 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove handling of missing =delete and =default supportAllan Sandfeld Jensen2019-05-021-1/+1
| | | | | Change-Id: I006dfd0b7cfa3bda5e5ab01bcefa851f031dfe0e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-04-061-1/+1
|\ | | | | | | Change-Id: Ib7c4fc52915b5e6c72b9aa262fb59f2a041dccd7
| * 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>
* | Replace Q_DECL_NOEXCEPT with noexcept in corelibAllan Sandfeld Jensen2019-04-031-97/+97
|/ | | | | | | In preparation of Qt6 move away from pre-C++11 macros. Change-Id: I44126693c20c18eca5620caab4f7e746218e0ce3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Revert "Atomics: remove qatomic_msvc.h"Kai Koehne2018-06-011-1/+13
| | | | | | | | | | | | | | | | 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>
* Atomics: remove qatomic_msvc.hThiago Macieira2018-03-191-14/+2
| | | | | | | | | No longer needed. The comment about missing constexpr support is incorrect: MSVC 2015 does have constexpr issues, but they don't affect our use of std::atomic. Change-Id: Ie9d9215342d449c48a11fffd151d11208137f00d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Port QSemaphore to use futexesThiago Macieira2017-09-181-0/+1
| | | | | | | | This is interesting because QSemaphore now needs to allocate no memory: it's just a simple 31-bit counter and the contention flag. Change-Id: I6e9274c1e7444ad48c81fffd14dbc0ab42bc2e00 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-11-231-0/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This also reverts commit 0d2f0164f45cb626c40a7c95026ba00fa56ac249. Conflicts: header.BSD-NEW qmake/Makefile.win32 src/openglextensions/qopenglextensions.cpp src/openglextensions/qopenglextensions.h src/winmain/qtmain_win.cpp src/winmain/qtmain_winrt.cpp tools/configure/configureapp.cpp util/glgen/qopenglextensions.cpp.header util/glgen/qopenglextensions.h.header Change-Id: If26c6f4111b342378dd88bbdc657e322d2ab6ad8
| * Enable constexpr support for Visual Studio 2017Oliver Wolff2016-11-221-0/+5
| | | | | | | | | | | | Change-Id: I894789c41cc2c1a327c14d0526e658520d096085 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-05-191-2/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure src/3rdparty/angle/src/libANGLE/renderer/d3d/d3d11/Renderer11.cpp src/network/access/qnetworkaccessmanager.cpp src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.cpp src/plugins/platforms/eglfs/deviceintegration/eglfs_kms/qeglfskmsgbmcursor.h src/widgets/widgets/qlineedit_p.cpp src/widgets/widgets/qlineedit_p.h src/winmain/winmain.pro tests/auto/corelib/io/qstorageinfo/tst_qstorageinfo.cpp tests/auto/dbus/qdbusconnection/tst_qdbusconnection.cpp tests/auto/dbus/qdbusconnection/tst_qdbusconnection.h tests/auto/testlib/selftests/expected_cmptest.teamcity tests/auto/testlib/selftests/expected_cmptest.txt tests/auto/widgets/itemviews/qtableview/tst_qtableview.cpp tools/configure/configureapp.cpp Change-Id: Ib9997b0d0f91946e4081d36c0c6b696c5c983b2a
| * Fix QBasicAtomicPointer::{load,store} to actually be relaxedThiago Macieira2016-05-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | We were using direct loading and operator=, which for everything except std::atomic was very relaxed. But std::atomic<T *> defines the direct access to actually be the least relaxed possible, under the idea that if you didn't know any better to use a member function, you probably need the most protection. So use Ops::load and Ops::store. Change-Id: Id5480807d25e49e78b79ffff144a06a2e6398576 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Add Intel copyright to files that Intel has had non-trivial contributionThiago Macieira2016-01-211-0/+1
| | | | | | | | | | | | | | | | | | I wrote a script to help find the files, but I reviewed the contributions manually to be sure I wasn't claiming copyright for search & replace, adding Q_DECL_NOTHROW or adding "We mean it" headers. Change-Id: I7a9e11d7b64a4cc78e24ffff142b506368fc8842 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | Force inclusion of <atomic> on QNX systems.Thiago Macieira2016-01-191-1/+3
| | | | | | | | | | | | | | | | | | | | It's documented to exist in QNX 6.6, which is the minimum required version for Qt 5.7 anyway. http://www.qnx.com/developers/docs/660/index.jsp?topic=/com.qnx.doc.dinkum/topic/cpp11/index.html Change-Id: I7e6338336dd6468ead24ffff141133a2d524f148 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Remove all the atomic code besides MSVC and std::atomicThiago Macieira2016-01-191-29/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][Important Behavior Changes] Starting with Qt 5.7, Qt requires a C++11 compiler with support for C++11 atomics. This affects user code too: Qt headers no longer compile with a C++98 compiler. The minimum compiler versions for this release are: * Clang 3.4 (found in XCode 5.1) * GCC 4.7 * Microsoft Visual Studio 2012 Change-Id: Ib056b47dde3341ef9a52ffff13ef1f496ea9363f Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
* | Updated license headersJani Heikkinen2016-01-151-13/+19
|/ | | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-11-171-2/+0
|\ | | | | | | Change-Id: I6b1fe0c6c360a0d5285911869f0f4f93d86d822e
| * Remove qatomic_mips.h: the 3-operand testAndSet is brokenThiago Macieira2015-11-051-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "previous" value is always 1 when the compare-and-swap succeeded, instead of the previous value. Instead of fixing this, let's just remove this file a bit earlier than the rest. All of them will be removed in Qt 5.7 anyway, so let's leave MIPS atomics to the compiler. Task-number: QTBUG-49168 Change-Id: Idba8c29717f34c70a58fffff14133304595165f5 Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lisandro Damián Nicanor Pérez Meyer <perezmeyer@gmail.com>
* | Make the C++11 atomic support the default, if availableThiago Macieira2015-10-161-6/+6
|/ | | | | Change-Id: Ib056b47dde3341ef9a52ffff13ef1647ccd607b1 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Add missing fetchAndXxx methods to atomic classes based on std::atomicThiago Macieira2015-03-051-0/+8
| | | | | | | | And add tests for the GCC intrinsics and for std::atomic. Task-number: QTBUG-43794 Change-Id: Ic5d393bfd36e48a193fcffff13b9b2dbaee80469 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Update copyright headersJani Heikkinen2015-02-111-6/+6
| | | | | | | | | | | | | | | | | | 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>
* Define Q_CC_CLANG to be the version of upstream Clang that's in useTor Arne Vestbø2014-11-051-7/+3
| | | | | | | | | | | | We map the Apple Clang versions to upstream, so that we have one define to compare against. Fixes build break on iOS due to qbasicatomic.h not defining QT_BASIC_ATOMIC_HAS_CONSTRUCTORS on Apple Clang versions, which is needed after 1e9db9f5e18123f2e686c10b Change-Id: I17493c0187c20abc5d22e71944d62bfd16afbad2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-18/+10
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Remove reference to removed qatomic_sparc.hAdam Majer2014-09-181-2/+0
| | | | | | | | | | qatomic_sparc.h was removed previously as part of general cleanup of old atomic code for Qt 5.3. Unfortunately SPARC include reference was not removed resulting in build failure on that platform. Task-number: QTBUG-41384 Change-Id: Ic6e31b32324b0e5dd3700a6a21515a8eea5668bd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add the rest of the non-volatile members of std::atomic to QBasicAtomicThiago Macieira2014-02-161-1/+83
| | | | | | | | | | [ChangeLog][QtCore][Atomic support]Added more operations to the atomic classes, including operator T(), operator=(T), operator++, operator--. For the QAtomicInteger, bit-manipulation operations are also provided, both in operator and in fetchAndXxxYyyyyy modes. Change-Id: I39c07be74e15e0a48f9e931f4342b182004dee1a Reviewed-by: David Faure <david.faure@kdab.com>
* Add a testAndSet overload to the atomics that returns the current valueThiago Macieira2014-02-161-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-301-1/+2
| | | | | | | | 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>
* Remove all "old atomic" code from QtThiago Macieira2013-12-101-21/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | The new atomic code was introduced in Qt 5.0. The platforms that did not get ported were announced as deprecated in Qt 5.2. The code is now removed in Qt 5.3. The status for the platform/compiler/OS combinations affected is: * Linux with GCC or Clang: still compiles on all platforms (via qatomic_cxx11.h or qatomic_gcc.h) * INTEGRITY with Green Hills compiler: no longer compiles * Solaris on UltraSPARC, with Sun Studio: no longer compiles * AIX on POWER5 or 6, with IBM Visual Age: no longer compiles (probably did not compile Qt 5.0 either) * VxWorks in kernel mode: no longer compiles [ChangeLog][General] Support for the following platforms has been removed, due to lack of interest in updating support: INTEGRITY, VxWorks, Solaris on UltraSPARC (with the Sun Studio compiler suite), AIX on POWER processors (with IBM Visual Age compiler suite). Change-Id: I8a961385fd95011c016b2b1eec52034794dae3e1 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Make a nicer output when QBasicAtomicInteger is used with a wrong TThiago Macieira2013-12-031-1/+1
| | | | | | | | | | | Before, we'd get just an error message that the size of the array was negative. Now, for C++11 compilers, we get a better error message: qbasicatomic.h:117:5: error: static assertion failed: Template parameter is not a supported integer on this platform qbasicatomic.h:119:24: error: invalid use of incomplete type ‘struct QAtomicOps<long long unsigned int>’ Change-Id: I6b0792254c0dc6103a4a7608f2942d59cda07c00 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* QBasicAtomicInt: fix wrong comment about non-atomic APIDavid Faure2013-11-021-3/+2
| | | | | | | | | | | | The public documentation for load() and store() says it's atomic, and it is: * using _q_value.store(newValue, std::memory_order_relaxed) in the C++11 implementation * using a simple assignment otherwise, which is atomic (and relaxed, no memory barriers) on all the existing C++ ABIs. Change-Id: I40faa47120163225bd11c3a32514ac97ef8bbbd4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Don't use ARMv5/6/7 atomics on 64-bit ARM, as they are AArch32 specificTor Arne Vestbø2013-09-161-3/+3
| | | | | Change-Id: I0c359e62a8cbf560691019187f316561bddbee52 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix C++11 support in clang prior to 3.2Jan Kundrát2013-04-121-2/+2
| | | | | | | | | | | | | The comments in this file suggested that the bug was only present in clang/3.1. However, qRegisterMetaType was failing even on clang 3.2 ("tags/RELEASE_32/final"). The clang's bugzilla says [1] that the problem was fixed two days before the release of 3.2, but apparently it didn't make it to the release branch. [1] http://llvm.org/bugs/show_bug.cgi?id=13470 Change-Id: I37db8f6f6b22ab939110e79240d92313c1786d6a Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* simplify/fix QT_BOOTSTRAPPED-related #ifdefsOswald Buddenhagen2013-03-141-1/+1
| | | | | | | | | | don't test for building specific tools when we actually only want to know whether we are bootstrapping. so far, this was only redundant; with the upcoming change of not bootstrapping unnecessarily it would be outright broken. Change-Id: I7600d8ebb14a4194640c50035e35a04263f2ccce Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>