Use g_once_init_{enter,leave}_pointer where appropriate

This should not result in any functional changes, but will eventually
allow glib to be functional on CHERI-enabled systems such as Morello.

Helps: https://gitlab.gnome.org/GNOME/glib/-/issues/2842
This commit is contained in:
Alex Richardson
2023-09-11 23:59:52 -07:00
committed by Philip Withnall
parent 726eca7c89
commit a1dfecf11f
25 changed files with 81 additions and 86 deletions

View File

@@ -355,7 +355,7 @@ g_vfs_get_default (void)
if (GLIB_PRIVATE_CALL (g_check_setuid) ())
return g_vfs_get_local ();
if (g_once_init_enter (&vfs_default_singleton))
if (g_once_init_enter_pointer (&vfs_default_singleton))
{
GVfs *singleton;
@@ -363,7 +363,7 @@ g_vfs_get_default (void)
"GIO_USE_VFS",
(GIOModuleVerifyFunc) g_vfs_is_active);
g_once_init_leave (&vfs_default_singleton, singleton);
g_once_init_leave_pointer (&vfs_default_singleton, singleton);
}
return vfs_default_singleton;
@@ -379,12 +379,12 @@ g_vfs_get_default (void)
GVfs *
g_vfs_get_local (void)
{
static gsize vfs = 0;
static GVfs *vfs = 0;
if (g_once_init_enter (&vfs))
g_once_init_leave (&vfs, (gsize)_g_local_vfs_new ());
if (g_once_init_enter_pointer (&vfs))
g_once_init_leave_pointer (&vfs, _g_local_vfs_new ());
return G_VFS (vfs);
return vfs;
}
/**