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);
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);
}
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);
}
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);
}
//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;
}
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;
}