QMetaType: use explicit load/store operations on QBasicAtomicInt
QBasicAtomicInt::operator int() does loadAcquire() and operator=() does storeRelease(). Pick-to: 6.2 6.3 6.4 Change-Id: Id0fb9ab0089845ee8843fffd16f9a1ece6823777 Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>bb10
parent
ff0c7dfc6e
commit
4c1b1f2ad8
|
|
@ -79,8 +79,8 @@ struct QMetaTypeCustomRegistry
|
|||
{
|
||||
{
|
||||
QWriteLocker l(&lock);
|
||||
if (ti->typeId)
|
||||
return ti->typeId;
|
||||
if (int id = ti->typeId.loadRelaxed())
|
||||
return id;
|
||||
QByteArray name =
|
||||
#ifndef QT_NO_QOBJECT
|
||||
QMetaObject::normalizedType
|
||||
|
|
@ -101,11 +101,11 @@ struct QMetaTypeCustomRegistry
|
|||
registry.append(ti);
|
||||
firstEmpty = registry.size();
|
||||
}
|
||||
ti->typeId = firstEmpty + QMetaType::User;
|
||||
ti->typeId.storeRelaxed(firstEmpty + QMetaType::User);
|
||||
}
|
||||
if (ti->legacyRegisterOp)
|
||||
ti->legacyRegisterOp();
|
||||
return ti->typeId;
|
||||
return ti->typeId.loadRelaxed();
|
||||
};
|
||||
|
||||
void unregisterDynamicType(int id)
|
||||
|
|
|
|||
Loading…
Reference in New Issue