From d273076b4474bb473d90e996960c4c773745761a Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 10 May 2019 10:51:14 +0200 Subject: 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 --- src/corelib/tools/qrefcount.h | 25 ------------------------- 1 file changed, 25 deletions(-) (limited to 'src/corelib/tools/qrefcount.h') 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 -- cgit v1.2.3