mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-23 10:42:11 +01:00
gio/tests/cancellable: Actually init atomic values with atomic functions
This is to make thread sanitizer happy, even those aren't really issues.
This commit is contained in:
parent
ee836d7723
commit
14da9d459c
@ -755,8 +755,11 @@ repeatedly_connecting_thread (gpointer data)
|
||||
|
||||
for (guint i = 0; i < iterations; ++i)
|
||||
{
|
||||
gboolean callback_called = FALSE; /* (atomic) */
|
||||
gboolean callback_called; /* (atomic) */
|
||||
gboolean called;
|
||||
|
||||
g_atomic_int_set (&callback_called, FALSE);
|
||||
|
||||
gulong id = g_cancellable_connect (cancellable,
|
||||
G_CALLBACK (on_racy_cancellable_cancelled),
|
||||
&callback_called, NULL);
|
||||
@ -780,13 +783,14 @@ test_cancellable_cancel_reset_connect_races (void)
|
||||
GThread *resetting_thread = NULL;
|
||||
GThread *cancelling_thread = NULL;
|
||||
GThread *connecting_thread = NULL;
|
||||
gboolean callback_called = FALSE; /* (atomic) */
|
||||
gboolean callback_called; /* (atomic) */
|
||||
|
||||
g_test_summary ("Tests threads racing for cancelling, connecting and disconnecting "
|
||||
" and resetting a GCancellable");
|
||||
|
||||
cancellable = g_cancellable_new ();
|
||||
|
||||
g_atomic_int_set (&callback_called, FALSE);
|
||||
g_cancellable_connect (cancellable, G_CALLBACK (on_racy_cancellable_cancelled),
|
||||
&callback_called, NULL);
|
||||
g_assert_false (g_atomic_int_get (&callback_called));
|
||||
|
Loading…
x
Reference in New Issue
Block a user