mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-28 04:31:06 +00:00
gdp: make public enum _get_type() functions thread-safe
Not that it is likely to matter in practice, but since these are public API they should probably be thread-safe.
This commit is contained in:
parent
dbbbe59577
commit
2c9ac5a4c9
1 changed files with 6 additions and 5 deletions
|
@ -292,18 +292,19 @@ gst_dp_dump_byte_array (guint8 * array, guint length)
|
||||||
GType
|
GType
|
||||||
gst_dp_version_get_type (void)
|
gst_dp_version_get_type (void)
|
||||||
{
|
{
|
||||||
static GType gst_dp_version_type = 0;
|
static gsize gst_dp_version_type = 0;
|
||||||
static const GEnumValue gst_dp_version[] = {
|
static const GEnumValue gst_dp_version[] = {
|
||||||
{GST_DP_VERSION_0_2, "GST_DP_VERSION_0_2", "0.2"},
|
{GST_DP_VERSION_0_2, "GST_DP_VERSION_0_2", "0.2"},
|
||||||
{GST_DP_VERSION_1_0, "GST_DP_VERSION_1_0", "1.0"},
|
{GST_DP_VERSION_1_0, "GST_DP_VERSION_1_0", "1.0"},
|
||||||
{0, NULL, NULL},
|
{0, NULL, NULL},
|
||||||
};
|
};
|
||||||
|
|
||||||
if (!gst_dp_version_type) {
|
if (g_once_init_enter (&gst_dp_version_type)) {
|
||||||
gst_dp_version_type =
|
GType tmp = g_enum_register_static ("GstDPVersion", gst_dp_version);
|
||||||
g_enum_register_static ("GstDPVersion", gst_dp_version);
|
g_once_init_leave (&gst_dp_version_type, tmp);
|
||||||
}
|
}
|
||||||
return gst_dp_version_type;
|
|
||||||
|
return (GType) gst_dp_version_type;
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue