31 lines
1.0 KiB
Diff
31 lines
1.0 KiB
Diff
From 22ef63cc44dca76c625e529951b5a10e397a1950 Mon Sep 17 00:00:00 2001
|
|
From: Colin Walters <walters@verbum.org>
|
|
Date: Thu, 02 Jun 2011 20:22:28 +0000
|
|
Subject: st-icon-colors: Use non-deprecated GAtomic API
|
|
|
|
---
|
|
diff --git a/src/st/st-icon-colors.c b/src/st/st-icon-colors.c
|
|
index 0655246..21bec6e 100644
|
|
--- a/src/st/st-icon-colors.c
|
|
+++ b/src/st/st-icon-colors.c
|
|
@@ -53,7 +53,7 @@ st_icon_colors_ref (StIconColors *colors)
|
|
g_return_val_if_fail (colors != NULL, NULL);
|
|
g_return_val_if_fail (colors->ref_count > 0, colors);
|
|
|
|
- g_atomic_int_add ((volatile int *)&colors->ref_count, 1);
|
|
+ g_atomic_int_inc ((volatile int *)&colors->ref_count);
|
|
return colors;
|
|
}
|
|
|
|
@@ -71,7 +71,7 @@ st_icon_colors_unref (StIconColors *colors)
|
|
g_return_if_fail (colors != NULL);
|
|
g_return_if_fail (colors->ref_count > 0);
|
|
|
|
- if (g_atomic_int_exchange_and_add ((volatile int *)&colors->ref_count, -1) - 1 == 0)
|
|
+ if (g_atomic_int_dec_and_test ((volatile int *)&colors->ref_count))
|
|
g_slice_free (StIconColors, colors);
|
|
}
|
|
|
|
--
|
|
cgit v0.9
|