[gnome-shell] st-icon-colors: Use non-deprecated GAtomic API



commit 22ef63cc44dca76c625e529951b5a10e397a1950
Author: Colin Walters <walters verbum org>
Date:   Thu Jun 2 16:22:28 2011 -0400

    st-icon-colors: Use non-deprecated GAtomic API

 src/st/st-icon-colors.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
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);
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]