summaryrefslogtreecommitdiff
path: root/gtk/spice-grabsequence.c
diff options
context:
space:
mode:
Diffstat (limited to 'gtk/spice-grabsequence.c')
-rw-r--r--gtk/spice-grabsequence.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gtk/spice-grabsequence.c b/gtk/spice-grabsequence.c
index dab438c..5d6fa9f 100644
--- a/gtk/spice-grabsequence.c
+++ b/gtk/spice-grabsequence.c
@@ -28,12 +28,15 @@
GType spice_grab_sequence_get_type(void)
{
static GType grab_sequence_type = 0;
+ static volatile gsize grab_sequence_type_volatile;
- if (G_UNLIKELY(grab_sequence_type == 0)) {
+ if (g_once_init_enter(&grab_sequence_type_volatile)) {
grab_sequence_type = g_boxed_type_register_static
("SpiceGrabSequence",
(GBoxedCopyFunc)spice_grab_sequence_copy,
(GBoxedFreeFunc)spice_grab_sequence_free);
+ g_once_init_leave(&grab_sequence_type_volatile,
+ grab_sequence_type);
}
return grab_sequence_type;