mirror of
				https://gitlab.gnome.org/GNOME/glib.git
				synced 2025-11-04 10:08:56 +01:00 
			
		
		
		
	gresource: Use compare and exchange full to get registered resources
This commit is contained in:
		
				
					committed by
					
						
						Philip Withnall
					
				
			
			
				
	
			
			
			
						parent
						
							28f83c9cf7
						
					
				
				
					commit
					ea904fba1a
				
			@@ -1364,11 +1364,10 @@ g_resources_get_info (const gchar           *path,
 | 
			
		||||
static void
 | 
			
		||||
register_lazy_static_resources_unlocked (void)
 | 
			
		||||
{
 | 
			
		||||
  GStaticResource *list;
 | 
			
		||||
  GStaticResource *list = g_atomic_pointer_get (&lazy_register_resources);
 | 
			
		||||
 | 
			
		||||
  do
 | 
			
		||||
    list = g_atomic_pointer_get (&lazy_register_resources);
 | 
			
		||||
  while (!g_atomic_pointer_compare_and_exchange (&lazy_register_resources, list, NULL));
 | 
			
		||||
  while (!g_atomic_pointer_compare_and_exchange_full (&lazy_register_resources, list, NULL, &list))
 | 
			
		||||
    ;
 | 
			
		||||
 | 
			
		||||
  while (list != NULL)
 | 
			
		||||
    {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user