summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2012-08-06 16:01:40 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-09 03:26:27 +0200
commit44e638f06965e1022a0da7a48105c83a6d373547 (patch)
tree11c6cb7391062e4bd63d970a19cf2b12b7aec859 /src
parent6bf4e448fee554153eab09c755ba6fdca012bd52 (diff)
Add Q_DECL_NOTHROW to QRefCount.
For the same reason as the previous commit (about the atomic classes), mark these functions as never throwing an exception. Change-Id: Idf46e41b226f54cb8658416efdf985ca40dd2952 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
Diffstat (limited to 'src')
-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;
};