st-shadow: Use non-deprecated GAtomic API
This commit is contained in:
parent
22ef63cc44
commit
af51e8df7b
@ -82,7 +82,7 @@ st_shadow_ref (StShadow *shadow)
|
|||||||
g_return_val_if_fail (shadow != NULL, NULL);
|
g_return_val_if_fail (shadow != NULL, NULL);
|
||||||
g_return_val_if_fail (shadow->ref_count > 0, shadow);
|
g_return_val_if_fail (shadow->ref_count > 0, shadow);
|
||||||
|
|
||||||
g_atomic_int_add (&shadow->ref_count, 1);
|
g_atomic_int_inc (&shadow->ref_count);
|
||||||
return shadow;
|
return shadow;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ st_shadow_unref (StShadow *shadow)
|
|||||||
g_return_if_fail (shadow != NULL);
|
g_return_if_fail (shadow != NULL);
|
||||||
g_return_if_fail (shadow->ref_count > 0);
|
g_return_if_fail (shadow->ref_count > 0);
|
||||||
|
|
||||||
if (g_atomic_int_exchange_and_add (&shadow->ref_count, -1) - 1 == 0)
|
if (g_atomic_int_dec_and_test (&shadow->ref_count))
|
||||||
g_slice_free (StShadow, shadow);
|
g_slice_free (StShadow, shadow);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user