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:
@@ -182,10 +182,6 @@ g_context_specific_group_get (GContextSpecificGroup *group,
|
||||
if (!group->table)
|
||||
group->table = g_hash_table_new (NULL, NULL);
|
||||
|
||||
/* start only if there are no others */
|
||||
if (start_func && g_hash_table_size (group->table) == 0)
|
||||
g_context_specific_group_request_state (group, TRUE, start_func);
|
||||
|
||||
css = g_hash_table_lookup (group->table, context);
|
||||
|
||||
if (!css)
|
||||
@@ -202,6 +198,9 @@ g_context_specific_group_get (GContextSpecificGroup *group,
|
||||
else
|
||||
g_object_ref (css->instance);
|
||||
|
||||
if (start_func)
|
||||
g_context_specific_group_request_state (group, TRUE, start_func);
|
||||
|
||||
g_mutex_unlock (&group->lock);
|
||||
|
||||
return css->instance;
|
||||
|
Reference in New Issue
Block a user