diff options
author | Lars Knoll <lars.knoll@qt.io> | 2019-05-10 10:51:14 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2019-10-30 16:39:37 +0100 |
commit | d273076b4474bb473d90e996960c4c773745761a (patch) | |
tree | aa548cb48203846f6e99691be58863501490736e /src/corelib/tools/qrefcount.h | |
parent | 7f70a4afa4ba63ffd4f9f989c89220dbf4f77adb (diff) |
Get rid of unsharable containers
The support for unsharable containers has been deprecated
since Qt 5.3.0, so let's finally remove support for them.
Change-Id: I9be31f55208ae4750e8020b10b6e4ad7e8fb3e0e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/corelib/tools/qrefcount.h')
-rw-r--r-- | src/corelib/tools/qrefcount.h | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/src/corelib/tools/qrefcount.h b/src/corelib/tools/qrefcount.h index 2e5388ad9a..982a9c2bbf 100644 --- a/src/corelib/tools/qrefcount.h +++ b/src/corelib/tools/qrefcount.h @@ -53,10 +53,6 @@ class RefCount public: inline bool ref() noexcept { int count = atomic.loadRelaxed(); -#if !defined(QT_NO_UNSHARABLE_CONTAINERS) - if (count == 0) // !isSharable - return false; -#endif if (count != -1) // !isStatic atomic.ref(); return true; @@ -64,32 +60,11 @@ public: inline bool deref() noexcept { int count = atomic.loadRelaxed(); -#if !defined(QT_NO_UNSHARABLE_CONTAINERS) - if (count == 0) // !isSharable - return false; -#endif if (count == -1) // isStatic return true; return atomic.deref(); } -#if !defined(QT_NO_UNSHARABLE_CONTAINERS) - bool setSharable(bool sharable) noexcept - { - Q_ASSERT(!isShared()); - if (sharable) - return atomic.testAndSetRelaxed(0, 1); - else - return atomic.testAndSetRelaxed(1, 0); - } - - bool isSharable() const noexcept - { - // Sharable === Shared ownership. - return atomic.loadRelaxed() != 0; - } -#endif - bool isStatic() const noexcept { // Persistent object, never deleted |