The implicit casts will be unavailable in the near future.
This is a follow up to commit
7f8472af8c03296be9e9ce50d8e9b3089eedf2f1,
which didn't catch all usages of the implicit cast and assignment
operator.
Change-Id: If05c343e2851b41e4a351c56328c4406c688fa0d
Reviewed-on: http://codereview.qt-project.org/6351
Sanity-Review: Qt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
QDeclarativeRefCount::~QDeclarativeRefCount()
{
- Q_ASSERT(refCount == 0);
+ Q_ASSERT(refCount.load() == 0);
}
void QDeclarativeRefCount::addref()
{
- Q_ASSERT(refCount > 0);
+ Q_ASSERT(refCount.load() > 0);
refCount.ref();
}
void QDeclarativeRefCount::release()
{
- Q_ASSERT(refCount > 0);
+ Q_ASSERT(refCount.load() > 0);
if (!refCount.deref())
destroy();
}
QDeclarativeDataBlob::Status QDeclarativeDataBlob::ThreadData::status() const
{
- return QDeclarativeDataBlob::Status((_p & TD_STATUS_MASK) >> TD_STATUS_SHIFT);
+ return QDeclarativeDataBlob::Status((_p.load() & TD_STATUS_MASK) >> TD_STATUS_SHIFT);
}
void QDeclarativeDataBlob::ThreadData::setStatus(QDeclarativeDataBlob::Status status)
{
while (true) {
- int d = _p;
+ int d = _p.load();
int nd = (d & ~TD_STATUS_MASK) | ((status << TD_STATUS_SHIFT) & TD_STATUS_MASK);
if (d == nd || _p.testAndSetOrdered(d, nd)) return;
}
bool QDeclarativeDataBlob::ThreadData::isAsync() const
{
- return _p & TD_ASYNC_MASK;
+ return _p.load() & TD_ASYNC_MASK;
}
void QDeclarativeDataBlob::ThreadData::setIsAsync(bool v)
{
while (true) {
- int d = _p;
+ int d = _p.load();
int nd = (d & ~TD_ASYNC_MASK) | (v?TD_ASYNC_MASK:0);
if (d == nd || _p.testAndSetOrdered(d, nd)) return;
}
quint8 QDeclarativeDataBlob::ThreadData::progress() const
{
- return quint8((_p & TD_PROGRESS_MASK) >> TD_PROGRESS_SHIFT);
+ return quint8((_p.load() & TD_PROGRESS_MASK) >> TD_PROGRESS_SHIFT);
}
void QDeclarativeDataBlob::ThreadData::setProgress(quint8 v)
{
while (true) {
- int d = _p;
+ int d = _p.load();
int nd = (d & ~TD_PROGRESS_MASK) | ((v << TD_PROGRESS_SHIFT) & TD_PROGRESS_MASK);
if (d == nd || _p.testAndSetOrdered(d, nd)) return;
}
{
QMutexLocker m1(&m_mutex);
m_queryIds.ref();
- if (m_queryIds <= 0)
- m_queryIds = 1;
+ if (m_queryIds.load() <= 0)
+ m_queryIds.store(1);
}
XmlQueryJob job;
- job.queryId = m_queryIds;
+ job.queryId = m_queryIds.load();
job.data = data;
job.query = QLatin1String("doc($src)") + query;
job.namespaces = namespaces;
{
QMutexLocker m1(&m_mutex);
m_queryIds.ref();
- if (m_queryIds <= 0)
- m_queryIds = 1;
+ if (m_queryIds.load() <= 0)
+ m_queryIds.store(1);
}
XmlQueryJob job;
- job.queryId = m_queryIds;
+ job.queryId = m_queryIds.load();
job.data = data;
job.query = QLatin1String("doc($src)") + query;
job.namespaces = namespaces;
{
QMutexLocker ml(&m_mutex);
- m_jobs.insert(m_queryIds, job);
+ m_jobs.insert(m_queryIds.load(), job);
}
QMetaObject::invokeMethod(this, "processQuery", Qt::QueuedConnection, Q_ARG(int, job.queryId));