aboutsummaryrefslogtreecommitdiff
path: root/qom/object.c
diff options
context:
space:
mode:
Diffstat (limited to 'qom/object.c')
-rw-r--r--qom/object.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/qom/object.c b/qom/object.c
index a91a6a515a..1196970635 100644
--- a/qom/object.c
+++ b/qom/object.c
@@ -867,7 +867,7 @@ Object *object_dynamic_cast_assert(Object *obj, const char *typename,
Object *inst;
for (i = 0; obj && i < OBJECT_CLASS_CAST_CACHE; i++) {
- if (atomic_read(&obj->class->object_cast_cache[i]) == typename) {
+ if (qatomic_read(&obj->class->object_cast_cache[i]) == typename) {
goto out;
}
}
@@ -884,10 +884,10 @@ Object *object_dynamic_cast_assert(Object *obj, const char *typename,
if (obj && obj == inst) {
for (i = 1; i < OBJECT_CLASS_CAST_CACHE; i++) {
- atomic_set(&obj->class->object_cast_cache[i - 1],
- atomic_read(&obj->class->object_cast_cache[i]));
+ qatomic_set(&obj->class->object_cast_cache[i - 1],
+ qatomic_read(&obj->class->object_cast_cache[i]));
}
- atomic_set(&obj->class->object_cast_cache[i - 1], typename);
+ qatomic_set(&obj->class->object_cast_cache[i - 1], typename);
}
out:
@@ -957,7 +957,7 @@ ObjectClass *object_class_dynamic_cast_assert(ObjectClass *class,
int i;
for (i = 0; class && i < OBJECT_CLASS_CAST_CACHE; i++) {
- if (atomic_read(&class->class_cast_cache[i]) == typename) {
+ if (qatomic_read(&class->class_cast_cache[i]) == typename) {
ret = class;
goto out;
}
@@ -978,10 +978,10 @@ ObjectClass *object_class_dynamic_cast_assert(ObjectClass *class,
#ifdef CONFIG_QOM_CAST_DEBUG
if (class && ret == class) {
for (i = 1; i < OBJECT_CLASS_CAST_CACHE; i++) {
- atomic_set(&class->class_cast_cache[i - 1],
- atomic_read(&class->class_cast_cache[i]));
+ qatomic_set(&class->class_cast_cache[i - 1],
+ qatomic_read(&class->class_cast_cache[i]));
}
- atomic_set(&class->class_cast_cache[i - 1], typename);
+ qatomic_set(&class->class_cast_cache[i - 1], typename);
}
out:
#endif
@@ -1166,7 +1166,7 @@ Object *object_ref(void *objptr)
if (!obj) {
return NULL;
}
- atomic_inc(&obj->ref);
+ qatomic_inc(&obj->ref);
return obj;
}
@@ -1179,7 +1179,7 @@ void object_unref(void *objptr)
g_assert(obj->ref > 0);
/* parent always holds a reference to its children */
- if (atomic_fetch_dec(&obj->ref) == 1) {
+ if (qatomic_fetch_dec(&obj->ref) == 1) {
object_finalize(obj);
}
}