[glib] Remove deprecated atomic functions from tests
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Remove deprecated atomic functions from tests
- Date: Mon, 6 Jun 2011 04:32:44 +0000 (UTC)
commit 1f022a88d4e46c1297d78a73c9331cd2ce2af53b
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Jun 6 00:30:02 2011 -0400
Remove deprecated atomic functions from tests
tests/atomic-test.c | 4 ++--
tests/onceinit.c | 10 +++++-----
2 files changed, 7 insertions(+), 7 deletions(-)
---
diff --git a/tests/atomic-test.c b/tests/atomic-test.c
index c2a67e4..3dd4b19 100644
--- a/tests/atomic-test.c
+++ b/tests/atomic-test.c
@@ -23,10 +23,10 @@ main (int argc,
g_assert (g_atomic_int_dec_and_test (&atomic));
g_assert (atomic == 0);
- g_assert (g_atomic_int_exchange_and_add (&atomic, 5) == 0);
+ g_assert (g_atomic_int_add (&atomic, 5) == 0);
g_assert (atomic == 5);
- g_assert (g_atomic_int_exchange_and_add (&atomic, -10) == 5);
+ g_assert (g_atomic_int_add (&atomic, -10) == 5);
g_assert (atomic == -5);
g_atomic_int_add (&atomic, 20);
diff --git a/tests/onceinit.c b/tests/onceinit.c
index 372eb2f..a57c171 100644
--- a/tests/onceinit.c
+++ b/tests/onceinit.c
@@ -32,7 +32,7 @@ static void
assert_singleton_execution1 (void)
{
static volatile int seen_execution = 0;
- int old_seen_execution = g_atomic_int_exchange_and_add (&seen_execution, 1);
+ int old_seen_execution = g_atomic_int_add (&seen_execution, 1);
if (old_seen_execution != 0)
g_error ("%s: function executed more than once", G_STRFUNC);
}
@@ -41,7 +41,7 @@ static void
assert_singleton_execution2 (void)
{
static volatile int seen_execution = 0;
- int old_seen_execution = g_atomic_int_exchange_and_add (&seen_execution, 1);
+ int old_seen_execution = g_atomic_int_add (&seen_execution, 1);
if (old_seen_execution != 0)
g_error ("%s: function executed more than once", G_STRFUNC);
}
@@ -50,7 +50,7 @@ static void
assert_singleton_execution3 (void)
{
static volatile int seen_execution = 0;
- int old_seen_execution = g_atomic_int_exchange_and_add (&seen_execution, 1);
+ int old_seen_execution = g_atomic_int_add (&seen_execution, 1);
if (old_seen_execution != 0)
g_error ("%s: function executed more than once", G_STRFUNC);
}
@@ -102,7 +102,7 @@ tmain_call_initializer3 (gpointer user_data)
//g_printf ("[");
initializer3();
//g_printf ("]\n");
- g_atomic_int_exchange_and_add (&thread_call_count, 1);
+ g_atomic_int_add (&thread_call_count, 1);
return NULL;
}
@@ -268,7 +268,7 @@ stress_concurrent_initializers (void *user_data)
for (i = 0; i < G_N_ELEMENTS (initializers); i++)
{
initializers[i]();
- g_atomic_int_exchange_and_add (&thread_call_count, 1);
+ g_atomic_int_add (&thread_call_count, 1);
}
return NULL;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]