mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-08-01 15:03:39 +02:00
ContextSpecificGroup: some fixups
For all of the effort spent ensuring that this algorithm would be correctly threadsafe, I messed up the order of operations within a single thread when porting to the new approach. Fix that up. Also: fix some overzealous asserting in the testcases. Since shutdown is now lazy, we can never surely say !is_running at any particular point in time.
This commit is contained in:
@@ -313,7 +313,7 @@ test_context_specific_identity (void)
|
||||
for (i = 0; i < N_THREADS; i++)
|
||||
exited |= GPOINTER_TO_UINT (g_thread_join (threads[i]));
|
||||
g_assert (exited);
|
||||
g_assert (!g_atomic_int_get (&is_running));
|
||||
g_assert (!group.requested_state);
|
||||
}
|
||||
|
||||
static void
|
||||
@@ -362,7 +362,6 @@ test_context_specific_emit (void)
|
||||
gboolean exited = FALSE;
|
||||
guint i, n;
|
||||
|
||||
g_assert (!g_atomic_int_get (&is_running));
|
||||
for (i = 0; i < N_THREADS; i++)
|
||||
threads[i] = g_thread_new ("test", test_emit_thread, &observed_values[i]);
|
||||
|
||||
@@ -397,7 +396,7 @@ test_context_specific_emit (void)
|
||||
for (i = 0; i < N_THREADS; i++)
|
||||
exited |= GPOINTER_TO_UINT (g_thread_join (threads[i]));
|
||||
g_assert (exited);
|
||||
g_assert (!g_atomic_int_get (&is_running));
|
||||
g_assert (!group.requested_state);
|
||||
}
|
||||
|
||||
int
|
||||
|
Reference in New Issue
Block a user