summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qrefcount.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/corelib/tools/qrefcount.h')
-rw-r--r--src/corelib/tools/qrefcount.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/corelib/tools/qrefcount.h b/src/corelib/tools/qrefcount.h
index 16b1d339b3..4306b65cb9 100644
--- a/src/corelib/tools/qrefcount.h
+++ b/src/corelib/tools/qrefcount.h
@@ -55,7 +55,7 @@ namespace QtPrivate
class RefCount
{
public:
- inline bool ref() {
+ inline bool ref() Q_DECL_NOTHROW {
int count = atomic.load();
if (count == 0) // !isSharable
return false;
@@ -64,7 +64,7 @@ public:
return true;
}
- inline bool deref() {
+ inline bool deref() Q_DECL_NOTHROW {
int count = atomic.load();
if (count == 0) // !isSharable
return false;
@@ -73,7 +73,7 @@ public:
return atomic.deref();
}
- bool setSharable(bool sharable)
+ bool setSharable(bool sharable) Q_DECL_NOTHROW
{
Q_ASSERT(!isShared());
if (sharable)
@@ -82,26 +82,26 @@ public:
return atomic.testAndSetRelaxed(1, 0);
}
- bool isStatic() const
+ bool isStatic() const Q_DECL_NOTHROW
{
// Persistent object, never deleted
return atomic.load() == -1;
}
- bool isSharable() const
+ bool isSharable() const Q_DECL_NOTHROW
{
// Sharable === Shared ownership.
return atomic.load() != 0;
}
- bool isShared() const
+ bool isShared() const Q_DECL_NOTHROW
{
int count = atomic.load();
return (count != 1) && (count != 0);
}
- void initializeOwned() { atomic.store(1); }
- void initializeUnsharable() { atomic.store(0); }
+ void initializeOwned() Q_DECL_NOTHROW { atomic.store(1); }
+ void initializeUnsharable() Q_DECL_NOTHROW { atomic.store(0); }
QBasicAtomicInt atomic;
};