108895a3886efe009e81fc82ce4a82b9401d07c8
diff --git a/libsoup/soup-cookie.c b/libsoup/soup-cookie.c
index 1b0c53a..0933032 100644
--- a/libsoup/soup-cookie.c
+++ b/libsoup/soup-cookie.c
@@ -130,16 +130,16 @@
 GType
 soup_cookie_get_type (void)
 {
-	static GType type = 0;
-
-	if (G_UNLIKELY (type == 0))
-	{
-		type = g_boxed_type_register_static ("SoupCookie",
-						     (GBoxedCopyFunc) soup_cookie_copy,
-						     (GBoxedFreeFunc) soup_cookie_free);
+	static volatile gsize type_volatile = 0;
+
+	if (g_once_init_enter (&type_volatile)) {
+		GType type = g_boxed_type_register_static (
+			g_intern_static_string ("SoupCookie"),
+			(GBoxedCopyFunc) soup_cookie_copy,
+			(GBoxedFreeFunc) soup_cookie_free);
+		g_once_init_leave (&type_volatile, type);
 	}
-
-	return type;
+	return type_volatile;
 }
 
 SoupCookie *
